Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page-fragment-container不能监听到props改变 #572

Open
clay6447 opened this issue Feb 1, 2024 · 4 comments
Open

page-fragment-container不能监听到props改变 #572

clay6447 opened this issue Feb 1, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@clay6447
Copy link

clay6447 commented Feb 1, 2024

PageFragmentContainer.vue
const fragment = computed(() => app?.dsl?.items?.find((page) => page.id === props.config.pageFragmentId);

这行代码里,由于props.config.pageFragmentId属性不是MComponent指定的属性值,而是一个[key: string]: any;
所以当pageFragmentId改变后,fragment值无法响应

我临时调用了一下name属性,暂时解决问题了:
const fragment = computed(() => {
console.log(props.config.name);
return app?.dsl?.items?.find((page) => page.id === props.config.pageFragmentId);
});

@clay6447
Copy link
Author

clay6447 commented Feb 1, 2024

但这样每次都要给name指定一个新值。。。。

@jia000
Copy link
Collaborator

jia000 commented Feb 26, 2024

是通过props.config.pageFragmentId = xxx 直接赋值的方式改变pageFragmentId 吗?

@khuntoriia
Copy link
Collaborator

建议使用page-fragement-select表单组件试试
{
name: 'pageFragmentId',
text: '页面片ID',
type: 'page-fragment-select',
},

@jia000
Copy link
Collaborator

jia000 commented Mar 5, 2024

可以参考:#568

@jia000 jia000 added the question Further information is requested label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants