mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 15:39:15 +08:00
chore: adjust popupSharedProps
This commit is contained in:
parent
28f2fe340c
commit
00395f0146
@ -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) => (
|
||||
<div
|
||||
@ -55,7 +55,7 @@ export default createComponent({
|
||||
route(vm.$router, vm);
|
||||
}}
|
||||
>
|
||||
{genIcon()}
|
||||
{renderIcon()}
|
||||
{slots.default ? slots.default() : props.text}
|
||||
</div>
|
||||
);
|
||||
|
@ -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 (
|
||||
<Popup
|
||||
show={props.show}
|
||||
class={[bem([props.type]), props.className]}
|
||||
style={style}
|
||||
position="top"
|
||||
overlay={false}
|
||||
position="top"
|
||||
duration={0.2}
|
||||
lockScroll={false}
|
||||
class={[bem([props.type]), props.className]}
|
||||
>
|
||||
{slots.default?.() || props.message}
|
||||
</Popup>
|
||||
|
@ -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: [
|
||||
|
@ -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'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user