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

加载amis自定义组件时报错:Uncaught TypeError: Cannot set properties of undefined (setting 'amisWidget') #26

Open
shuracwf opened this issue Sep 6, 2023 · 3 comments

Comments

@shuracwf
Copy link

shuracwf commented Sep 6, 2023

我从webpack换成vite打包后,使用amisWidget使用build2lib生成的umd组件,加载的时候报这个错误,请问是什么问题?
image

@iceqing
Copy link
Owner

iceqing commented Sep 7, 2023

是否能给一个示例项目demo?

@qidasheng369
Copy link

qidasheng369 commented Jan 20, 2024

按照官网的自定义组件 - React,注册完报错,提示:
`Error: 找不到对应的渲染器

Path: page/body/0/crud/dialog/dialog/body/form/7/my-renderer2

{
"type": "my-renderer2",
"tip": "简单示例",
"body": {
"type": "form",
"body": [
{
"type": "input-text",
"label": "用户名",
"name": "usename"
}
]
}
}`。
请问如何注册自定义组件呢?

bf4e0927b6e44002bb7304d87269093
977a4cc24a00a94eb764f1e75bff2c4

@iceqing
Copy link
Owner

iceqing commented Jan 20, 2024

添加完毕自定义组件MyRenderder2.tsx后,需要手工import组件,在程序入口处或者使用的地方import就行,比如在index.tsx里import '@src/componests/MyRenderder2'; , 然后重启服务就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants