Home

Awesome

Weex-AMUI

安装

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>

使用前

npm i less less-loader -D
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
      }
    ]
  ]
}
npm i https://github.com/HMingHe/weex-vue-precompiler.git -D

eros 用户

{
  ...
  "plugins": [
    ["import",[
      {
        "libraryName": "weex-amui",
        "libraryDirectory": "packages",
        "style": false
      }
    ]
  ...
}

运行 Demo

npm i
npm run start

参考或者直接使用了他们的代码,感谢

Ant Design Mobile weex-ui weex-flymeui