zui doc && 命名空间更改

This commit is contained in:
pangxie1991 2016-12-20 11:23:39 +08:00
parent a7660c2580
commit 4255eaf9a7
7 changed files with 21 additions and 21 deletions

16
dist/toast/index.js vendored
View File

@ -1,28 +1,28 @@
module.exports = {
showZuiToast(title, timeout) {
var componentToast = this.data.componentToast || {};
clearTimeout(componentToast.timer);
var zuiToast = this.data.zuiToast || {};
clearTimeout(zuiToast.timer);
// 弹层设置~
componentToast = {
zuiToast = {
show: true,
title
};
this.setData({
componentToast
zuiToast
});
componentToast.timer = setTimeout(() => {
zuiToast.timer = setTimeout(() => {
this.clearZuiToast();
}, timeout || 3000);
},
clearZuiToast() {
var componentToast = this.data.componentToast || {};
clearTimeout(componentToast.timer);
var zuiToast = this.data.zuiToast || {};
clearTimeout(zuiToast.timer);
this.setData({
'componentToast.show': false
'zuiToast.show': false
});
}
};

View File

@ -1,3 +1,3 @@
<template name="zui-toast">
<view class="zui-toast" wx:if="{{ componentToast.show }}" bindtap="clearToast">{{ componentToast.title }}</view>
<view class="zui-toast" wx:if="{{ zuiToast.show }}" bindtap="clearToast">{{ zuiToast.title }}</view>
</template>

View File

@ -21,7 +21,7 @@ module.exports = {
// 展示出topTips
this.setData({
componentTopTips: {
zuiTopTips: {
show: true,
content,
options
@ -31,7 +31,7 @@ module.exports = {
// 设置定时器定时关闭topTips
timer = setTimeout(() => {
this.setData({
'componentTopTips.show': false
'zuiTopTips.show': false
});
timer = undefined;
}, options.duration);

View File

@ -1,3 +1,3 @@
<template name="zui-toptips">
<view class="zui-toptips {{ componentTopTips.show ? 'zui-toptips--show' : '' }}">{{ componentTopTips.content }}</view>
<view class="zui-toptips {{ zuiTopTips.show ? 'zui-toptips--show' : '' }}">{{ zuiTopTips.content }}</view>
</template>

View File

@ -3,7 +3,7 @@
<view class="zui-panel">
<view class="zui-cell">
<view class="zui-cell__bd">
<view class="pull-right">pull-right: 往右靠</view>
<view class="zui-pull-right">zui-pull-right: 往右靠</view>
</view>
</view>
@ -15,18 +15,18 @@
<view class="zui-cell">
<view class="zui-cell__bd">
<view class="zui-font-12 zui-font-bold">
<view>zui-font-12字号12</view>
<view>zui-font-bold加粗</view>
<view>
<view class="zui-font-12">zui-font-12字号12</view>
<view class="zui-font-12 zui-font-bold">zui-font-bold再来个加粗</view>
</view>
</view>
</view>
<view class="zui-cell">
<view class="zui-cell__bd">
<view class="zui-font-16 zui-font-bold">
<view>zui-font-16字号16</view>
<view>zui-font-bold加粗</view>
<view>
<view class="zui-font-16">zui-font-16字号16</view>
<view class="zui-font-16 zui-font-bold">zui-font-bold再来个加粗</view>
</view>
</view>
</view>

View File

@ -12,4 +12,4 @@
</view>
</view>
<template is="zui-toast" data="{{ componentToast }}"></template>
<template is="zui-toast" data="{{ zuiToast }}"></template>

View File

@ -12,4 +12,4 @@
</view>
</view>
<template is="zui-toptips" data="{{ componentTopTips }}"></template>
<template is="zui-toptips" data="{{ zuiTopTips }}"></template>