diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js index f3f6d0f6..042a9061 100644 --- a/dist/action-sheet/index.js +++ b/dist/action-sheet/index.js @@ -1,8 +1,7 @@ import { VantComponent } from '../common/component'; import { button } from '../mixins/button'; -import { openType } from '../mixins/open-type'; VantComponent({ - mixins: [button, openType], + mixins: [button], props: { show: Boolean, title: String, @@ -40,12 +39,21 @@ VantComponent({ methods: { onSelect(event) { const { index } = event.currentTarget.dataset; - const item = this.data.actions[index]; - if (item && !item.disabled && !item.loading) { + const { actions, closeOnClickAction, canIUseGetUserProfile } = this.data; + const item = actions[index]; + if (item) { this.$emit('select', item); - if (this.data.closeOnClickAction) { + if (closeOnClickAction) { this.onClose(); } + if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: item.getUserProfileDesc || ' ', + complete: (userProfile) => { + this.$emit('getuserinfo', userProfile); + }, + }); + } } }, onCancel() { diff --git a/dist/action-sheet/index.wxml b/dist/action-sheet/index.wxml index c2bebcac..b04cc3a3 100644 --- a/dist/action-sheet/index.wxml +++ b/dist/action-sheet/index.wxml @@ -27,18 +27,18 @@