条件付きコンポーネントは'source'でappidを受け取ることができる。
This commit is contained in:
@@ -69,13 +69,22 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
sourceType: {
|
||||
type: String,
|
||||
default: 'field'
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
const source = props.context.find(element => element?.props?.name === 'sources')
|
||||
|
||||
if (source) {
|
||||
provide('sourceFields', computed( () => source.props?.modelValue?.fields ?? []));
|
||||
if(props.sourceType === 'field'){
|
||||
provide('sourceFields', computed( () => source.props?.modelValue?.fields ?? []));
|
||||
} else if(props.sourceType === 'app'){
|
||||
console.log('sourceApp', source.props?.modelValue);
|
||||
provide('sourceApp', computed( () => source.props?.modelValue?.app?.id));
|
||||
}
|
||||
}
|
||||
|
||||
const appDg = ref();
|
||||
|
||||
Reference in New Issue
Block a user