Compare commits

...

2 Commits

Author SHA1 Message Date
zhangtao 8dc6937c30 Merge branch 'zhangtao' of zhangtao/restructure into develop 2022-05-26 15:09:09 +08:00
zhangtao 2c068079cf table switch 2022-05-26 15:08:32 +08:00
2 changed files with 3 additions and 5 deletions

View File

@ -4,11 +4,9 @@
<script>
import { defineComponent, ref, unref, computed } from 'vue'
import { NSwitch } from 'naive-ui'
export default defineComponent({
name: 'TableSwitch',
props: {
...NSwitch.props,
data: {
type: [Object, String, Number, Boolean],
required: true
@ -18,7 +16,7 @@ export default defineComponent({
default: ''
}
},
emits: ['getRow'],
emits: ['change'],
setup(props, { emit }) {
const switchVlue = ref()
const { data, rowKey } = unref(props)
@ -34,7 +32,7 @@ export default defineComponent({
data,
value
}
emit('getRow', params)
emit('change', params)
}
return {
switchVlue,

View File

@ -90,7 +90,7 @@ export default {
rowKey: 'status',
checkedValue: 1,
uncheckedValue: 2,
onGetRow: getSwitch.bind(row)
onChange: getSwitch.bind(row)
})
}
},