This commit is contained in:
2019-12-14 09:20:48 +08:00
parent 57e95e3217
commit 933673b092
372 changed files with 8090 additions and 0 deletions

1
utils/dist/tab/index.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export {};

56
utils/dist/tab/index.js vendored Normal file
View File

@@ -0,0 +1,56 @@
import { VantComponent } from '../common/component';
VantComponent({
relation: {
name: 'tabs',
type: 'ancestor',
linked(target) {
this.parent = target;
},
unlinked() {
this.parent = null;
}
},
props: {
dot: Boolean,
info: null,
title: String,
disabled: Boolean,
titleStyle: String,
name: {
type: [Number, String],
value: '',
}
},
data: {
active: false
},
watch: {
title: 'update',
disabled: 'update',
dot: 'update',
info: 'update',
titleStyle: 'update'
},
methods: {
getComputedName() {
if (this.data.name !== '') {
return this.data.name;
}
return this.index;
},
updateRender(active, parent) {
const { data: parentData } = parent;
this.inited = this.inited || active;
this.setData({
active,
shouldRender: this.inited || !parentData.lazyRender,
shouldShow: active || parentData.animated
});
},
update() {
if (this.parent) {
this.parent.updateTabs();
}
}
}
});

3
utils/dist/tab/index.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"component": true
}

8
utils/dist/tab/index.wxml vendored Normal file
View File

@@ -0,0 +1,8 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<view
class="custom-class {{ utils.bem('tab__pane', { active, inactive: !active }) }}"
style="{{ shouldShow ? '' : 'display: none;' }}"
>
<slot wx:if="{{ shouldRender }}" />
</view>

1
utils/dist/tab/index.wxss vendored Normal file
View File

@@ -0,0 +1 @@
@import '../common/index.wxss';:host{-webkit-flex-shrink:0;flex-shrink:0;width:100%}.van-tab__pane,:host{box-sizing:border-box}.van-tab__pane{overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible}