babel-plugin-component
lack of style configuration, You can refer to Weex-toolkit to fix it.You can refer to this document to fix it.
If you are using a Windows system, you may still have this problem when you upgrade, you check the babel config about webpack.config.js
, modify exclude
like this:
rules: [{ test: /\.js$/, use: [{ loader: 'babel-loader' }], exclude: /node_modules(?!(\/|\\).*(weex).*)/ }]
I‘m sorry, Weex currently doesn’t support horizontal screen, so Weex Ui doesn't have any horizontal screen mode yet. When Weex supports it, it will follow immediately.
You can send a message to weex at the horizontal screen, Then handle this in your code.
function getHWidth (w) { return deviceWidth / w * 750 } const meta = weex.requireModule('meta') // set viewport width meta.setViewport({ width: getHWidth(w) // W is the width of the design draft })
Weex Ui can write once and support iOS / Android / Html5 right now!
But if you want to use it in a pure vue project, you can replace it with this one, but not recommended:
import { WxcComponent1, WxcComponent2 } from "weex-ui/build/index.web.js"
Yes, but you need modify some config
Add a exclude
in build/webpack.base.weex.conf.js
Like this:
module: { rules: [ { test: /\.vue(\?[^?]+)?$/, loaders: ['weex-loader'], exclude: /node_modules(?!(\/|\\).*(weex).*)/ }, { test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules(?!(\/|\\).*(weex).*)/ } ] }
Please add ‘babel-preset-stage-0’ and ‘babel-plugin-component’ to .babelrc
npm i babel-plugin-component babel-preset-stage-0 -D
Edit the .babelrc
like this
{ "presets": ["es2015", "stage-0"], "plugins": [ [ "component", { "libraryName": "weex-ui", "libDir": "packages", "style": false } ] ] }
---- More questions can be found from the [issue list](https://github.com/apache/incubator-weex-ui/issues?utf8=%E2%9C%93&q=). If you find a new bug, Just file an [issue](https://github.com/apache/incubator-weex-ui/issues/new).