代码拉取完成,页面将自动刷新
npm i weex-amui -S
<template>
<div>
<am-button
@click="handleClick"
text="确定"
type="primary"/>
</div>
</template>
<script>
import { AmButton } from 'weex-amui';
export default {
components: { AmButton },
methods: {
handleClick () {
// enter your code
}
}
};
</script>
less-loader
以正确编译less源码npm i less less-loader -D
babel-preset-stage-0
,也需要一并安装。eros用户跳过这一步,点这里看
npm i babel-preset-stage-0 babel-plugin-component -D
// 增加一个plugins的配置到 .babelrc 中
{
"presets": ["es2015", "stage-0"],
"plugins": [
[
"component",
{
"libraryName": "weex-amui",
"libDir": "packages",
"style": false
}
// 如果要和 weex-ui 一起用,配置加上下面这个
,{
"libraryName": "weex-ui",
"libDir": "packages",
"style": false
}
]
]
}
weex-vue-render@1.x
版本(现在使用 weex-toolkit
创建的项目可选0.x
和1.x
),1.x版本依赖的 weex-vue-precompiler
当前版本会把自定义组件的 click
, change
等事件处理出错,需要安装一下另外一个修改的版本。npm i https://github.com/HMingHe/weex-vue-precompiler.git -D
.babelrc
文件,如下:{
...
"plugins": [
["import",[
{
"libraryName": "weex-amui",
"libraryDirectory": "packages",
"style": false
}
]
...
}
npm i
npm run start
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。