Browse Source

table switch

pull/6/head
zhangtao 2 years ago
parent
commit
2c068079cf
2 changed files with 3 additions and 5 deletions
  1. +2
    -4
      src/components/DataTable/tools/Switch.vue
  2. +1
    -1
      src/views/system/user/index.vue

+ 2
- 4
src/components/DataTable/tools/Switch.vue 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,

+ 1
- 1
src/views/system/user/index.vue View File

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

Loading…
Cancel
Save