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

微信小程序转钉钉小程序, 关于weui的转换 #72

Open
JnNanghty opened this issue Feb 18, 2022 · 2 comments
Open

微信小程序转钉钉小程序, 关于weui的转换 #72

JnNanghty opened this issue Feb 18, 2022 · 2 comments

Comments

@JnNanghty
Copy link

小程序使用weui component

"mp-checkbox": "weui-miniprogram/checkbox/checkbox"

会被转换成

"mp-checkbox": "weui-aliapp/dist/components/checkbox/checkbox"

但是编译的时候却报错,提示

Error: Can't resolve 'weui-aliapp/dist/components/checkbox/checkbox' in 'd:\xxx\xxx\xxx\xxx'

问题:
1、是否真正转换了weui?
2、如果没有转换, 那么有什么解决办法吗?

@JnNanghty
Copy link
Author

npmjs上搜索 weui-aliapp , 然后npm i 下载下来放到钉钉小程序目录下, 然后把转变后的路径改为相对路径就行。 使用绝对路径的话会提示 "...” 这个解构操作符报错。

@JnNanghty
Copy link
Author

https://opendocs.alipay.com/mini/006kyi#%E7%AC%AC%E4%B8%89%E6%96%B9%20NPM%20%E6%A8%A1%E5%9D%97

支付宝小程序原话
注意: 由于node_modules 里第三方模块代码不会经过转换器,为了确保各个终端兼容,node_modules 下的代码需要转成 ES5 格式再引用,模块格式推荐使用 ES2015 的 import/export。同时,浏览器相关 web 能力同样无法使用。

因为这个所以不支持 node_modules下的 '...' 运算符

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

1 participant