Comments (3)
配置问题,解决了
1、安装babel插件: npm i babel-preset-stage-0 babel-plugin-component -D
2、安装weex-ui和weex-amui: npm i weex-ui -S 和 npm i weex-amui -S
3、在 .babelrc 文件中添加
{
"presets": [
"es2015",
"stage-0"
],
"plugins": [
[
"component",
{
"libraryName": "weex-amui",
"libDir": "packages",
"style": false
}
// 如果要和 weex-ui 一起用,配置加上下面这个
,{
"libraryName": "weex-ui",
"libDir": "packages",
"style": false
}
],
["transform-runtime", {
"polyfill": false,
"helpers": false
}]
]
}
现在的问题是按需引入只对第一个起作用(无法同时对两个起作用),如果想weex-ui起作用就把它放到第一个
from eeui.
要同时做到weex-ui和weex-amui按需引入,你需要修改 .babelrc文件如下:
{
"presets": [
"es2015",
"stage-0"
],
"plugins": [
[
"component",
[
{
"libraryName": "weex-amui",
"libDir": "packages",
"style": false
},
{
"libraryName": "weex-ui",
"libDir": "packages",
"style": false
}
]
],
[
"transform-runtime",
{
"helpers": false,
"polyfill": false
}
]
]
}
这可能是因为“babel-pugin-component”的官方配置错误引起的,请看这个:同时按需引入两个组件,官方的配置报错,如何配置
使用eeui Demo项目在windows和mac环境下实测,均是可以做到weex-ui和weex-amui按需引入的:
实际build出来的JS文件只有37kb左右
from eeui.
感觉是我的环境问题
from eeui.
Related Issues (20)
- 第三方页面,需要调用eeui上的原生功能,如何通信
- 朋友们,你们的努力方向错了,我们讨论一下,改个方向才有前途 HOT 6
- eeui.openPage softInputMode:'nothing' keyboard事件丢失
- eeui/lottie. 忽略
- How to reduce output (apk/ipa) size? HOT 5
- when I create new project, this happened
- error when i use "eeui run android"
- h5与原生插件交互,onJsPrompt方法所能接收的message最大10kb左右,超过自动截断数据,有什么解决办法?
- Android新手挖坑指南 HOT 1
- 安卓11,用了toast组件后闪退。 HOT 2
- component SideDrawer?
- BUG: android build never finish HOT 1
- Android端
- Android端:场景示例:目前顺序打开a、b、c、d四个页面,d为当前页面,打开第五个页面e,需要关闭前面a、b、c、d四个页面,如何实现 HOT 1
- 下载的模板2.5.0出现,CMake Error: The source directory "../plugins/eeui/WeexSDK/android/sdk/src/legacyRelease/cpp" does not exist.这个问题怎么回事
- 不维护了吗,好尴尬 HOT 2
- 怎么设置首页状态栏的背景色 HOT 2
- appboard下面使用import引入其他js文件的时候报错,ReferenceError: Can't find variable: require HOT 1
- as 连接真机编译debug的问题
- dependency app.eeui:zxing:1.0.2的maven仓库地址无法访问
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eeui.