仿互站小程序

This commit is contained in:
Drawfans
2020-06-09 16:17:23 +08:00
commit 7bfd53851e
321 changed files with 22890 additions and 0 deletions

44
vant/collapse/index.js Normal file
View File

@@ -0,0 +1,44 @@
(0, require("../common/component").VantComponent)({
relation: {
name: "collapse-item",
type: "descendant",
linked: function(e) {
this.children.push(e);
},
unlinked: function(e) {
this.children = this.children.filter(function(n) {
return n !== e;
});
}
},
props: {
value: {
type: null,
observer: "updateExpanded"
},
accordion: {
type: Boolean,
observer: "updateExpanded"
},
border: {
type: Boolean,
value: !0
}
},
beforeCreate: function() {
this.children = [];
},
methods: {
updateExpanded: function() {
this.children.forEach(function(e) {
e.updateExpanded();
});
},
switch: function(e, n) {
var t = this.data, i = t.accordion, o = t.value;
e = i ? n ? e : "" : n ? (o || []).concat(e) : (o || []).filter(function(n) {
return n !== e;
}), this.$emit("change", e), this.$emit("input", e);
}
}
});

13
vant/collapse/index.json Normal file
View File

@@ -0,0 +1,13 @@
{
"component": true,
"usingComponents": {
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

3
vant/collapse/index.wxml Normal file
View File

@@ -0,0 +1,3 @@
<view class="custom-class van-collapse {{border?'van-hairline--top-bottom':''}}">
<slot></slot>
</view>

1
vant/collapse/index.wxss Normal file
View File

@@ -0,0 +1 @@
@import "../area/index.wxss";