From 00395f014615a1ef8acf9b4568fa4547915fcb11 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Mon, 24 Aug 2020 10:27:55 +0800 Subject: [PATCH] chore: adjust popupSharedProps --- src/action-bar-icon/index.js | 6 +++--- src/notify/Notify.js | 6 ++---- src/popup/index.js | 33 ++++++++++++++++----------------- src/share-sheet/index.js | 10 ---------- 4 files changed, 21 insertions(+), 34 deletions(-) diff --git a/src/action-bar-icon/index.js b/src/action-bar-icon/index.js index 009b3c325..39a0ad1ce 100644 --- a/src/action-bar-icon/index.js +++ b/src/action-bar-icon/index.js @@ -22,7 +22,7 @@ export default createComponent({ setup(props, { slots }) { useParent(ACTION_BAR_KEY, ref()); - function genIcon() { + const renderIcon = () => { const { dot, badge, icon, color, iconClass } = props; if (slots.icon) { @@ -44,7 +44,7 @@ export default createComponent({ class={[bem('icon'), iconClass]} /> ); - } + }; return (vm) => (
- {genIcon()} + {renderIcon()} {slots.default ? slots.default() : props.text}
); diff --git a/src/notify/Notify.js b/src/notify/Notify.js index 01d3dc32a..977b7fee2 100644 --- a/src/notify/Notify.js +++ b/src/notify/Notify.js @@ -8,8 +8,6 @@ export default createComponent({ ...popupSharedProps, color: String, message: [Number, String], - duration: [Number, String], - teleport: [String, Object], className: null, background: String, type: { @@ -28,12 +26,12 @@ export default createComponent({ return ( {slots.default?.() || props.message} diff --git a/src/popup/index.js b/src/popup/index.js index cf2dfa00d..c93d7fb3c 100644 --- a/src/popup/index.js +++ b/src/popup/index.js @@ -26,18 +26,21 @@ const context = { export const popupSharedProps = { // whether to show popup show: Boolean, - // whether to show overlay - overlay: Boolean, + // z-index + zIndex: [Number, String], + // transition duration + duration: [Number, String], + // teleport + teleport: [String, Object], // overlay custom style overlayStyle: Object, // overlay custom class name overlayClass: String, - // teleport - teleport: [String, Object], - // whether to close popup when click overlay - closeOnClickOverlay: Boolean, - // z-index - zIndex: [Number, String], + // whether to show overlay + overlay: { + type: Boolean, + default: true, + }, // prevent body scroll lockScroll: { type: Boolean, @@ -48,6 +51,11 @@ export const popupSharedProps = { type: Boolean, default: true, }, + // whether to close popup when click overlay + closeOnClickOverlay: { + type: Boolean, + default: true, + }, }; export default createComponent({ @@ -58,7 +66,6 @@ export default createComponent({ props: { ...popupSharedProps, round: Boolean, - duration: [Number, String], closeable: Boolean, transition: String, safeAreaInsetBottom: Boolean, @@ -74,14 +81,6 @@ export default createComponent({ type: String, default: 'center', }, - overlay: { - type: Boolean, - default: true, - }, - closeOnClickOverlay: { - type: Boolean, - default: true, - }, }, emits: [ diff --git a/src/share-sheet/index.js b/src/share-sheet/index.js index 429539f5e..59f63e105 100644 --- a/src/share-sheet/index.js +++ b/src/share-sheet/index.js @@ -12,18 +12,12 @@ export default createComponent({ props: { ...popupSharedProps, title: String, - duration: [Number, String], - teleport: [String, Object], cancelText: String, description: String, options: { type: Array, default: () => [], }, - overlay: { - type: Boolean, - default: true, - }, closeOnPopstate: { type: Boolean, default: true, @@ -32,10 +26,6 @@ export default createComponent({ type: Boolean, default: true, }, - closeOnClickOverlay: { - type: Boolean, - default: true, - }, }, emits: ['cancel', 'select', 'update:show', 'click-overlay'],