Skip to content

Commit

Permalink
chore: action-sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Nov 9, 2023
1 parent 6ee1d71 commit 62daef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
15 changes: 4 additions & 11 deletions src/packages/__VUE/actionsheet/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:z-index="zIndex"
@click-overlay="close"
>
<view :class="classes">
<view class="nut-action-sheet">
<view v-if="title" class="nut-action-sheet__title">{{ title }}</view>
<slot></slot>
<view v-if="!slotDefault">
Expand Down Expand Up @@ -40,12 +40,12 @@
</template>
<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import { computed, useSlots } from 'vue';
import { useSlots } from 'vue';
import type { PropType } from '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');
const { create } = createComponent('action-sheet');
export interface menuItems {
disable: boolean;
loading: boolean;
Expand Down Expand Up @@ -102,12 +102,6 @@ export default create({
setup(props, { emit }) {
const slotDefault = !!useSlots().default;
const classes = computed(() => {
const prefixCls = componentName;
return {
[prefixCls]: true
};
});
const isHighlight = (item: { [x: string]: string | boolean }) => {
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag] ? props.color : '';
Expand Down Expand Up @@ -137,8 +131,7 @@ export default create({
isHighlight,
cancelActionSheet,
chooseItem,
close,
classes
close
};
}
});
Expand Down
15 changes: 4 additions & 11 deletions src/packages/__VUE/actionsheet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:z-index="zIndex"
@click-overlay="close"
>
<view :class="classes">
<view class="nut-action-sheet">
<view v-if="title" class="nut-action-sheet__title">{{ title }}</view>
<slot></slot>
<view v-if="!slotDefault">
Expand Down Expand Up @@ -39,12 +39,12 @@
</template>
<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import { computed, useSlots } from 'vue';
import { useSlots } from 'vue';
import type { PropType } from 'vue';
import { popupProps } from '../popup/props';
import Popup from '../popup/index.vue';
import { Loading } from '@nutui/icons-vue';
const { componentName, create } = createComponent('action-sheet');
const { create } = createComponent('action-sheet');
export interface menuItems {
disable: boolean;
loading: boolean;
Expand Down Expand Up @@ -101,12 +101,6 @@ export default create({
setup(props, { emit }) {
const slotDefault = !!useSlots().default;
const classes = computed(() => {
const prefixCls = componentName;
return {
[prefixCls]: true
};
});
const isHighlight = (item: { [x: string]: string | boolean }) => {
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag] ? props.color : '';
Expand Down Expand Up @@ -136,8 +130,7 @@ export default create({
isHighlight,
cancelActionSheet,
chooseItem,
close,
classes
close
};
}
});
Expand Down

0 comments on commit 62daef4

Please sign in to comment.