mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-22 06:31:45 +08:00
chore(Popover): change name of default slot to reference
This commit is contained in:
parent
699a5ebe51
commit
64e17bcd08
@ -58,5 +58,5 @@ Vue.use(Popover);
|
|||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
| 名称 | 说明 |
|
| 名称 | 说明 |
|
||||||
| ------- | -------------------- |
|
| --------- | --------------------------- |
|
||||||
| default | 自定义菜单的展示内容 |
|
| reference | 触发 Popover 显示的元素内容 |
|
||||||
|
@ -7,9 +7,11 @@
|
|||||||
placement="bottom"
|
placement="bottom"
|
||||||
style="margin-left: 16px;"
|
style="margin-left: 16px;"
|
||||||
>
|
>
|
||||||
|
<template #reference>
|
||||||
<van-button type="primary" @click="show.lightTheme = true">
|
<van-button type="primary" @click="show.lightTheme = true">
|
||||||
{{ t('lightTheme') }}
|
{{ t('lightTheme') }}
|
||||||
</van-button>
|
</van-button>
|
||||||
|
</template>
|
||||||
</van-popover>
|
</van-popover>
|
||||||
<van-popover
|
<van-popover
|
||||||
v-model="show.darkTheme"
|
v-model="show.darkTheme"
|
||||||
@ -18,9 +20,11 @@
|
|||||||
placement="bottom"
|
placement="bottom"
|
||||||
style="margin-left: 16px;"
|
style="margin-left: 16px;"
|
||||||
>
|
>
|
||||||
|
<template #reference>
|
||||||
<van-button type="primary" @click="show.darkTheme = true">
|
<van-button type="primary" @click="show.darkTheme = true">
|
||||||
{{ t('darkTheme') }}
|
{{ t('darkTheme') }}
|
||||||
</van-button>
|
</van-button>
|
||||||
|
</template>
|
||||||
</van-popover>
|
</van-popover>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
@ -55,7 +59,9 @@
|
|||||||
:actions="t('shortActions')"
|
:actions="t('shortActions')"
|
||||||
:placement="currentPlacement"
|
:placement="currentPlacement"
|
||||||
>
|
>
|
||||||
|
<template #reference>
|
||||||
<div class="demo-popover-refer" />
|
<div class="demo-popover-refer" />
|
||||||
|
</template>
|
||||||
</van-popover>
|
</van-popover>
|
||||||
</div>
|
</div>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
@ -67,9 +73,11 @@
|
|||||||
placement="top"
|
placement="top"
|
||||||
style="margin-left: 16px;"
|
style="margin-left: 16px;"
|
||||||
>
|
>
|
||||||
|
<template #reference>
|
||||||
<van-button type="primary" @click="show.showIcon = true">
|
<van-button type="primary" @click="show.showIcon = true">
|
||||||
{{ t('showIcon') }}
|
{{ t('showIcon') }}
|
||||||
</van-button>
|
</van-button>
|
||||||
|
</template>
|
||||||
</van-popover>
|
</van-popover>
|
||||||
|
|
||||||
<van-popover
|
<van-popover
|
||||||
@ -78,9 +86,11 @@
|
|||||||
placement="top"
|
placement="top"
|
||||||
style="margin-left: 16px;"
|
style="margin-left: 16px;"
|
||||||
>
|
>
|
||||||
|
<template #reference>
|
||||||
<van-button type="primary" @click="show.disabled = true">
|
<van-button type="primary" @click="show.disabled = true">
|
||||||
{{ t('disabled') }}
|
{{ t('disabled') }}
|
||||||
</van-button>
|
</van-button>
|
||||||
|
</template>
|
||||||
</van-popover>
|
</van-popover>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
</demo-section>
|
</demo-section>
|
||||||
|
@ -168,7 +168,7 @@ export default createComponent({
|
|||||||
<div class={bem('arrow')} />
|
<div class={bem('arrow')} />
|
||||||
{this.actions.map(this.renderAction)}
|
{this.actions.map(this.renderAction)}
|
||||||
</Popup>
|
</Popup>
|
||||||
{this.slots('default')}
|
{this.slots('reference')}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user