Weex Ui 是一个基于 Weex 的富交互、轻量级、高性能的移动端 UI 组件库

Github资源:https://github.com/alibaba/weex-ui

预览

你可以通过飞猪淘宝天猫Weex Playground 或者浏览器扫码体验

安装
npm i weex-ui -S
使用
<template>
  <div>
    <wxc-button text="Open Popup"                 @wxcButtonClicked="buttonClicked"></wxc-button>     <wxc-popup width="500"                pos="left"                :show="isShow"                @wxcPopupOverlayClicked="overlayClicked"></wxc-popup>   </div> </template> <script>   import { WxcButton, WxcPopup } from 'weex-ui';   module.exports = {     components: { WxcButton, WxcPopup },     data: () => ({       isShow: false     }),     methods: {       buttonClicked () {         this.isShow = true;       },       overlayClicked () {         this.isShow = false;       }     }   }; </script>
汇集使用 (推荐)
import { WxcComponent1, WxcComponent2 } from "weex-ui"

为了不打包所有的组件,你需要使用 babel-plugin-component 来只引入需要的组件打包。

npm i babel-plugin-component -D
// 增加一个plugins的配置到 .babelrc 中
{
  "plugins": [
    [
      "component",
      {
        "libraryName": "weex-ui",
        "libDir": "packages"       }     ]   ] }
分开使用
import WxcComponent1 from "weex-ui/packages/wxc-component1"
import WxcComponent2 from "weex-ui/packages/wxc-component2"
Weex-toolkit

如果你使用weex-toolkit来开发你的Weex项目,你需要向 .babelrc 文件中加入 'state-0' 和 'babel-plugin-component'

npm i babel-preset-stage-0 babel-plugin-component  -D
{
  "presets": ["es2015", "stage-0"],
  "plugins": [
    [
      "component",
      {
        "libraryName": "weex-ui",         "libDir": "packages"       }     ]   ] }

转载于:https://www.cnblogs.com/boonya/p/8456385.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值