|
|
@@ -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, |