table switch
This commit is contained in:
parent
ceeab5ebdc
commit
2c068079cf
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ export default {
|
|||
rowKey: 'status',
|
||||
checkedValue: 1,
|
||||
uncheckedValue: 2,
|
||||
onGetRow: getSwitch.bind(row)
|
||||
onChange: getSwitch.bind(row)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue