Compare commits

..

No commits in common. "8dc6937c30c4833cebe2160bee7b57a9169d61ac" and "413c0eac110aee132ae2a124edbe30262874a9f5" have entirely different histories.

2 changed files with 5 additions and 3 deletions

View File

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

View File

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