diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx index 2bdf3b027..2f395e88f 100644 --- a/src/action-sheet/index.tsx +++ b/src/action-sheet/index.tsx @@ -26,6 +26,7 @@ export type ActionSheetProps = PopupMixinProps & { title?: string; actions?: ActionSheetItem[]; duration: number; + closeIcon: string; cancelText?: string; description?: string; closeOnClickAction?: boolean; @@ -52,7 +53,7 @@ function ActionSheet( return (
{title} - +
); } @@ -158,6 +159,10 @@ ActionSheet.props = { type: Boolean, default: true }, + closeIcon: { + type: String, + default: 'close' + }, safeAreaInsetBottom: { type: Boolean, default: true diff --git a/src/action-sheet/test/__snapshots__/index.spec.js.snap b/src/action-sheet/test/__snapshots__/index.spec.js.snap index d662348fc..ac00f117a 100644 --- a/src/action-sheet/test/__snapshots__/index.spec.js.snap +++ b/src/action-sheet/test/__snapshots__/index.spec.js.snap @@ -6,6 +6,13 @@ exports[`callback events 1`] = ` `; +exports[`close-icon prop 1`] = ` +
+
Title +
+
+`; + exports[`color option 1`] = `
`; exports[`description prop 1`] = ` @@ -16,6 +23,12 @@ exports[`description prop 1`] = ` exports[`disable lazy-render 1`] = ``; -exports[`render title and default slot 1`] = ``; +exports[`render title and default slot 1`] = ` +
+
Title +
+
Default
+
+`; exports[`round prop 1`] = `
`; diff --git a/src/action-sheet/test/index.spec.js b/src/action-sheet/test/index.spec.js index 8fe5bb2af..bc9fb4556 100644 --- a/src/action-sheet/test/index.spec.js +++ b/src/action-sheet/test/index.spec.js @@ -96,6 +96,7 @@ test('disable lazy-render', () => { test('render title and default slot', () => { const wrapper = mount(ActionSheet, { propsData: { + value: true, title: 'Title' }, scopedSlots: { @@ -174,3 +175,15 @@ test('description prop', () => { expect(wrapper).toMatchSnapshot(); }); + +test('close-icon prop', () => { + const wrapper = mount(ActionSheet, { + propsData: { + value: true, + title: 'Title', + closeIcon: 'cross' + } + }); + + expect(wrapper).toMatchSnapshot(); +});