This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop-wechat/components/actionsheet/index.js

42 lines
910 B
JavaScript
Raw Permalink Normal View History

2020-04-25 22:59:04 +08:00
'use strict';
Component({
externalClasses: ['mask-class', 'container-class'],
properties: {
actions: {
type: Array,
value: []
},
show: {
type: Boolean,
value: false
},
cancelWithMask: {
type: Boolean,
value: true
},
cancelText: {
type: String,
value: ''
}
},
methods: {
onMaskClick: function onMaskClick() {
if (this.data.cancelWithMask) {
this.cancelClick();
}
},
cancelClick: function cancelClick() {
this.triggerEvent('cancel');
},
handleBtnClick: function handleBtnClick(_ref) {
var _ref$currentTarget = _ref.currentTarget,
currentTarget = _ref$currentTarget === undefined ? {} : _ref$currentTarget;
var dataset = currentTarget.dataset || {};
var index = dataset.index;
this.triggerEvent('actionclick', { index: index });
}
}
});