仿互站小程序
This commit is contained in:
38
vant/action-sheet/index.js
Normal file
38
vant/action-sheet/index.js
Normal file
@@ -0,0 +1,38 @@
|
||||
var e = require("../common/component"), t = require("../mixins/safe-area");
|
||||
|
||||
(0, e.VantComponent)({
|
||||
mixins: [ (0, t.safeArea)() ],
|
||||
props: {
|
||||
show: Boolean,
|
||||
title: String,
|
||||
cancelText: String,
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 100
|
||||
},
|
||||
actions: {
|
||||
type: Array,
|
||||
value: []
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: !0
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: !0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelect: function(e) {
|
||||
var t = e.currentTarget.dataset.index, n = this.data.actions[t];
|
||||
!n || n.disabled || n.loading || this.$emit("select", n);
|
||||
},
|
||||
onCancel: function() {
|
||||
this.$emit("cancel");
|
||||
},
|
||||
onClose: function() {
|
||||
this.$emit("close");
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user