@mini-dev/directive-views
v0.0.3
Published
用组件方式来调用小程序的API
Downloads
1
Readme
@mini-dev/directive-views
用组件方式来调用小程序的 API。
安装
npm install @mini-dev/directive-views --save
使用
首先需要在对应的页面引入对应的组件:
{
"usingComponents": {
"copy": "@mini-dev/directive-views/copy/index",
"debug": "@mini-dev/directive-views/debug/index",
"function": "@mini-dev/directive-views/function/index",
"route": "@mini-dev/directive-views/route/index"
}
}
复制(copy)
<copy value="你好">
<button type="default">复制 value 的值</button>
</copy>
调试开关(debug)
<debug open="开启调试" close="关闭调试"/>
函数调用(function)
<function directive-class='function' name='function1' arg="{name:'fn1'}" auto />
<function directive-class='function' name='function1' arg="[1,'a', {name:''fn1}]" auto />
路由(route)
<route directive-class="route" url="/pages/page2/index" auto/>
更多配置方式:具体可以参见示例 pages
Changelogs
0.0.3
- 增加function的数组参数;
- 统一 ext-class 的使用方式;
0.0.2
- 修正针对小程序的 package.json 配置;
0.0.1
- 添加常用的操作;