-- bug 项目

This commit is contained in:
yuping
2022-12-03 20:07:39 +08:00
parent b49e47749d
commit c2692a615c

View File

@@ -31,7 +31,7 @@ export default {
props: { props: {
value: { value: {
type: Number, type: String,
}, },
name: { name: {
type: String, type: String,
@@ -46,14 +46,14 @@ export default {
const state = reactive({ const state = reactive({
options: [], options: [],
id: props.value id: props.value+''
}); });
watch(props, () => { watch(props, () => {
console.log('props', state) console.log('props', state)
console.log('props', props) console.log('props', props)
if (props.value !== state.id) { if ((props.value + '') !== state.id) {
state.id = props.value state.id = props.value + ''
} }
}) })
onMounted(() => { onMounted(() => {
@@ -64,7 +64,7 @@ export default {
function change(key, obj) { function change(key, obj) {
console.log(state) console.log(state)
ctx.emit('update:name', obj[0]) ctx.emit('update:name', obj[0])
ctx.emit('update:value', key) ctx.emit('update:value', key + '')
} }
return { return {