仿互站小程序

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

28
vant/row/index.js Normal file
View File

@@ -0,0 +1,28 @@
(0, require("../common/component").VantComponent)({
relation: {
name: "col",
type: "descendant",
linked: function(t) {
this.data.gutter && t.setGutter(this.data.gutter);
}
},
props: {
gutter: Number
},
watch: {
gutter: "setGutter"
},
mounted: function() {
this.data.gutter && this.setGutter();
},
methods: {
setGutter: function() {
var t = this, e = this.data.gutter, n = "-" + Number(e) / 2 + "px", r = e ? "margin-right: " + n + "; margin-left: " + n + ";" : "";
this.set({
style: r
}), this.getRelationNodes("../col/index").forEach(function(e) {
e.setGutter(t.data.gutter);
});
}
}
});