From 1f67c2899831106bff869a63c0e627aa61542b3b Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 6 Aug 2018 11:46:10 +0800 Subject: [PATCH] [Improvement] Actionsheet: add select event (#1594) --- packages/actionsheet/demo/index.vue | 24 ++++++++------- packages/actionsheet/en-US.md | 27 +++++++++++------ packages/actionsheet/index.vue | 9 +++--- .../test/__snapshots__/index.spec.js.snap | 2 +- packages/actionsheet/test/index.spec.js | 8 +++-- packages/actionsheet/zh-CN.md | 30 ++++++++++++------- 6 files changed, 64 insertions(+), 36 deletions(-) diff --git a/packages/actionsheet/demo/index.vue b/packages/actionsheet/demo/index.vue index d77dd76d6..099d165d1 100644 --- a/packages/actionsheet/demo/index.vue +++ b/packages/actionsheet/demo/index.vue @@ -2,12 +2,18 @@ {{ $t('button1') }} - + {{ $t('button2') }} - + @@ -53,20 +59,22 @@ export default { computed: { actions() { return [ - { name: this.$t('option'), callback: this.onClick }, + { name: this.$t('option') }, { name: this.$t('option'), subname: this.$t('description') }, - { name: this.$t('option'), loading: true }, + { loading: true }, { name: this.$t('disabledOption'), disabled: true } ]; } }, methods: { - onClick(item) { + onSelect(item) { + this.show1 = false; + this.show2 = false; this.$toast(item.name); }, - handleCancel() { + onCancel() { this.$toast('cancel'); } } @@ -75,10 +83,6 @@ export default {