We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
请问如何引入原生自定义组件? 谢谢
The text was updated successfully, but these errors were encountered:
这个问题本质上是把已有的原生自定义组件【复制】到 dist/ 目录中,假设这些组件放在 src/foobar/ 目录下,需要拷贝到 dist/foobar/ 下。可以在 tua-mp.config.js 这样写:
dist/
src/foobar/
dist/foobar/
tua-mp.config.js
// tua-mp.config.js module.exports = { chainWebpack: (config) => { config .plugin('copy-webpack-plugin') .tap(([ patterns, ...rest ]) => ([ [ ...patterns, // 小程序组件目录 { from: 'foobar/', to: 'foobar/' }, ], ...rest, ])) }, }
假设其中有某个组件叫做 Dialog,之后在页面、组件里引入路径就是这样
Dialog
{ "usingComponents": { "Dialog": "/foobar/Dialog/Dialog" }, }
回头补一下文档和示例...
Sorry, something went wrong.
BuptStEve
No branches or pull requests
请问如何引入原生自定义组件? 谢谢
The text was updated successfully, but these errors were encountered: