当前位置:网站首页>FE - weex 开发 之 使用 weex-ui 组件与配置使用
FE - weex 开发 之 使用 weex-ui 组件与配置使用
2022-07-02 06:22:00 【原小明】
weex-ui
weex - ui 阿里飞猪出品
https://github.com/alibaba/weex-ui
使用
进入 weex 项目根目录
npm i weex-ui -S
配置
(1) 以下面方式使用
import { WxcComponent1, WxcComponent2 } from "weex-ui"
缺点是导入了全部的 weex-ui
组件,也会打包;
1. 安装插件
npm i babel-preset-stage-0 babel-plugin-component -D
2. 配置插件
在 .babelrc
文件中添加插件配置
{
"presets": [ "es2015", "stage-0" ],
"plugins": [ [ "component", { "libraryName": "weex-ui", "libDir": "packages" } ] ] }
3.使用
以标题为例子
<template class="HomeView">
<div>
<wxc-minibar title="睿畜保" background-color="#009ff0" text-color="#FFFFFF" right-text="更多"></wxc-minibar>
<text>Index 页面</text>
</div>
</template>
<script> import {WxcMinibar} from 'weex-ui' export default{ name: "HomeView", components: { WxcMinibar }, created(){ } } </script>
<style> </style>
(2) 以另一种方式
只导入自己想用的组件即可
import WxcComponent1 from "weex-ui/packages/wxc-component1"
import WxcComponent2 from "weex-ui/packages/wxc-component2"
边栏推荐
- DeprecationWarning: .ix is deprecated. Please use.loc for label based indexing or.iloc for positi
- LeetCode 77. 组合
- Generic classes and parameterized classes of SystemVerilog
- Linked list (linear structure)
- 底层机制Mvcc
- Top 10 classic MySQL errors
- Redis - cluster data distribution algorithm & hash slot
- Monitoring uplink of VRRP
- 深入了解JUC并发(一)什么是JUC
- 注解和反射详解以及运用
猜你喜欢
随机推荐
Redis——热点key问题
BGP 路由优选规则和通告原则
Redis - hot key issues
找到页面当前元素z-index最高的数值
LeetCode 83. Delete duplicate elements in the sorting linked list
DeprecationWarning: .ix is deprecated. Please use.loc for label based indexing or.iloc for positi
ctf-web之练习赛
Cglib agent - Code enhancement test
Golang--map扩容机制(含源码)
Name six schemes to realize delayed messages at one go
LeetCode 283. Move zero
LeetCode 283. 移动零
Codeforces Round #797 (Div. 3) A—E
LeetCode 90. 子集 II
程序员的自我修养—找工作反思篇
【张三学C语言之】—深入理解数据存储
CUDA中的动态全局内存分配和操作
TensorRT中的循环
稀疏数组(非线性结构)
阿里云MFA绑定Chrome浏览器