mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[build] 3.0.3
This commit is contained in:
parent
9a4ceca7e1
commit
bce357cfc0
50
dist/cell/index.js
vendored
50
dist/cell/index.js
vendored
@ -48,29 +48,24 @@ Component({
|
||||
isLastCell: true
|
||||
},
|
||||
methods: {
|
||||
navigateTo() {
|
||||
const { url = '' } = this.data;
|
||||
const type = typeof this.data.isLink;
|
||||
footerTap() {
|
||||
// 如果并没有设置只点击 footer 生效,那就不需要额外处理。cell 上有事件会自动处理
|
||||
if (!this.data.onlyTapFooter) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.triggerEvent('tap', {});
|
||||
|
||||
if (!this.data.isLink || !url || url === 'true' || url === 'false') return;
|
||||
|
||||
if (type !== 'boolean' && type !== 'string') {
|
||||
warn('isLink 属性值必须是一个字符串或布尔值', this.data.isLink);
|
||||
return;
|
||||
}
|
||||
|
||||
if (['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'].indexOf(this.data.linkType) === -1) {
|
||||
warn('linkType 属性可选值为 navigateTo,redirectTo,switchTab,reLaunch', this.data.linkType);
|
||||
return;
|
||||
}
|
||||
wx[this.data.linkType].call(wx, { url });
|
||||
doNavigate.call(this);
|
||||
},
|
||||
|
||||
cellTap() {
|
||||
if (!this.data.onlyTapFooter) {
|
||||
this.navigateTo();
|
||||
// 如果只点击 footer 生效,那就不需要在 cell 根节点上处理
|
||||
if (this.data.onlyTapFooter) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.triggerEvent('tap', {});
|
||||
doNavigate.call(this);
|
||||
},
|
||||
|
||||
// 用于被 cell-group 更新,标志是否是最后一个 cell
|
||||
@ -79,3 +74,22 @@ Component({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 处理跳转
|
||||
function doNavigate() {
|
||||
const { url = '' } = this.data;
|
||||
const type = typeof this.data.isLink;
|
||||
|
||||
if (!this.data.isLink || !url || url === 'true' || url === 'false') return;
|
||||
|
||||
if (type !== 'boolean' && type !== 'string') {
|
||||
warn('isLink 属性值必须是一个字符串或布尔值', this.data.isLink);
|
||||
return;
|
||||
}
|
||||
|
||||
if (['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'].indexOf(this.data.linkType) === -1) {
|
||||
warn('linkType 属性可选值为 navigateTo,redirectTo,switchTab,reLaunch', this.data.linkType);
|
||||
return;
|
||||
}
|
||||
wx[this.data.linkType].call(wx, { url });
|
||||
}
|
||||
|
4
dist/cell/index.wxml
vendored
4
dist/cell/index.wxml
vendored
@ -1,5 +1,5 @@
|
||||
<view
|
||||
bindtap="cellTap"
|
||||
catchtap="cellTap"
|
||||
class="zan-cell {{ isLastCell ? 'last-cell' : '' }} {{ isLink ? 'zan-cell--access' : '' }}">
|
||||
|
||||
<view class="zan-cell__icon">
|
||||
@ -12,7 +12,7 @@
|
||||
<slot></slot>
|
||||
</view>
|
||||
|
||||
<view catchtap="navigateTo" class="zan-cell__ft">
|
||||
<view bindtap="footerTap" class="zan-cell__ft">
|
||||
<block wx:if="{{value}}">{{ value }}</block>
|
||||
<block wx:else>
|
||||
<slot name="footer"></slot>
|
||||
|
1
dist/dialog/index.wxml
vendored
1
dist/dialog/index.wxml
vendored
@ -23,6 +23,7 @@
|
||||
class="zan-dialog__button"
|
||||
custom-class="{{ index === 0 ? 'zan-dialog__button-inside--first' : 'zan-dialog__button-inside' }}"
|
||||
data-type="{{ item.type }}"
|
||||
open-type="{{ item.openType }}"
|
||||
bind:btnclick="handleButtonClick"
|
||||
>
|
||||
<view
|
||||
|
Loading…
x
Reference in New Issue
Block a user