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> <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
@ -18,7 +16,7 @@ export default defineComponent({
default: '' default: ''
} }
}, },
emits: ['getRow'], emits: ['change'],
setup(props, { emit }) { setup(props, { emit }) {
const switchVlue = ref() const switchVlue = ref()
const { data, rowKey } = unref(props) const { data, rowKey } = unref(props)
@ -34,7 +32,7 @@ export default defineComponent({
data, data,
value value
} }
emit('getRow', params) emit('change', 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,
onGetRow: getSwitch.bind(row) onChange: getSwitch.bind(row)
}) })
} }
}, },