mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 14:56:46 +08:00
-- 修改
This commit is contained in:
@@ -22,55 +22,30 @@
|
||||
>
|
||||
</a-tree-select>
|
||||
</template>
|
||||
<script>
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
<script setup>
|
||||
import {computed, defineEmits, defineProps, onMounted, ref} from "vue";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "OrgClass",
|
||||
const store = useStore();
|
||||
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const store = useStore();
|
||||
const props = defineProps({
|
||||
value: String
|
||||
})
|
||||
const emit = defineEmits({})
|
||||
|
||||
const state = reactive({
|
||||
options: [],
|
||||
id: props.value+''
|
||||
});
|
||||
const options = ref([])
|
||||
|
||||
watch(props, () => {
|
||||
console.log('props', state)
|
||||
console.log('props', props)
|
||||
if ((props.value + '') !== state.id) {
|
||||
state.id = props.value + ''
|
||||
}
|
||||
})
|
||||
onMounted(() => {
|
||||
state.options = [...store.state.orgtreeList]
|
||||
console.log(state.options)
|
||||
})
|
||||
const id = computed(() => {
|
||||
return props.value
|
||||
})
|
||||
|
||||
function change(key, obj) {
|
||||
console.log(state)
|
||||
ctx.emit('update:name', obj[0])
|
||||
ctx.emit('update:value', key + '')
|
||||
}
|
||||
onMounted(() => {
|
||||
options.value = [...store.state.orgtreeList]
|
||||
})
|
||||
|
||||
function change(key, obj) {
|
||||
emit('update:name', obj[0])
|
||||
emit('update:value', key)
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
change
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user