基于 Weex 的 UI 组件库 Weex Ui

码农软件 · 软件分类 · UI组件库 · 2019-08-01 17:59:13

软件介绍

Weex Ui 是一个基于 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://codercto.com/soft/d/11428.html

大学算法教程

大学算法教程

约翰森堡 / 清华大学 / 2007-6 / 69.80元

本书是美国德保罗大学DePaul University教授R.Johnsonbaugh等人长期从事算法课程教学经验的结晶,是一本关于算法基础知识和基本方法的教科书。内容包括:算法必备的数学基础、数据结构和描述算法的语言与记号;常用算法的设计分析及其正确性证明;NP和NP完全问题的特征及其近似处理方法。 全书含300多个生动有趣的算法实际示例和1450多道习题,从经典方法到最新成果,层层剖析......一起来看看 《大学算法教程》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试