Skip to content

Commit

Permalink
fix(actionsheet): 修复 close-abled 失效问题 (#2496)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Aug 23, 2023
1 parent 652b990 commit 37a7b50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/packages/__VUE/actionsheet/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import { createComponent } from '@/packages/utils/create';
import { computed, useSlots } from 'vue';
import type { PropType } from 'vue';
const { componentName, create } = createComponent('action-sheet');
import Popup from '../popup/index.taro.vue';
import { popupProps } from '../popup/props';
import Popup from '../popup/index.taro.vue';
import { Loading } from '@nutui/icons-vue-taro';
const { componentName, create } = createComponent('action-sheet');
export interface menuItems {
disable: boolean;
loading: boolean;
Expand Down Expand Up @@ -89,7 +89,7 @@ export default create({
default: true
}
},
emits: ['cancel', 'choose', 'update:visible', 'close'],
emits: ['cancel', 'close', 'choose', 'update:visible'],
setup(props, { emit }) {
const slotDefault = !!useSlots().default;
Expand Down Expand Up @@ -117,8 +117,10 @@ export default create({
};
const close = (e: Event) => {
emit('close', e);
emit('update:visible', false);
if (props.closeAbled) {
emit('close', e);
emit('update:visible', false);
}
};
return {
Expand Down
6 changes: 4 additions & 2 deletions src/packages/__VUE/actionsheet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ export default create({
};
const close = (e: Event) => {
emit('close', e);
emit('update:visible', false);
if (props.closeAbled) {
emit('close', e);
emit('update:visible', false);
}
};
return {
Expand Down

0 comments on commit 37a7b50

Please sign in to comment.