소스 검색

Merge branch 'zhangtao' of gitadmin/tuoheng_pilot_web into develop

pull/81/head
zhangtao 1 년 전
부모
커밋
d1ccedcfa1
1개의 변경된 파일13개의 추가작업 그리고 6개의 파일을 삭제
  1. +13
    -6
      src/components/DataTable/tools/Switch.vue

+ 13
- 6
src/components/DataTable/tools/Switch.vue 파일 보기

@@ -1,9 +1,9 @@
<template>
<n-switch v-bind="getSwitchProps" v-model:value="switchVlue" @update:value="changeValue" />
<n-switch v-bind="getSwitchProps" v-model:value="getSwitchValue" @update:value="changeValue" />
</template>

<script>
import { defineComponent, ref, unref, computed } from 'vue'
import { defineComponent, unref, computed } from 'vue'
export default defineComponent({
name: 'TableSwitch',
props: {
@@ -18,10 +18,16 @@ export default defineComponent({
},
emits: ['change'],
setup(props, { emit }) {
const switchVlue = ref()
const { data, rowKey } = unref(props)
switchVlue.value = rowKey ? data[rowKey] : data
// const switchValue = ref()
// const { data, rowKey } = unref(props)
// switchValue.value = rowKey ? data[rowKey] : data
const getSwitchValue = computed(() => {
const { data, rowKey } = unref(props)
const value = rowKey ? data[rowKey] : data
return value
})
const getSwitchProps = computed(() => {
console.log(111)
return {
...unref(props)
}
@@ -35,7 +41,8 @@ export default defineComponent({
emit('change', params)
}
return {
switchVlue,
// switchValue,
getSwitchValue,
getSwitchProps,
changeValue
}

Loading…
취소
저장