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
@ -57,6 +57,6 @@ Vue.use(Popover);
|
||||
|
||||
### Slots
|
||||
|
||||
| 名称 | 说明 |
|
||||
| ------- | -------------------- |
|
||||
| default | 自定义菜单的展示内容 |
|
||||
| 名称 | 说明 |
|
||||
| --------- | --------------------------- |
|
||||
| reference | 触发 Popover 显示的元素内容 |
|
||||
|
@ -7,9 +7,11 @@
|
||||
placement="bottom"
|
||||
style="margin-left: 16px;"
|
||||
>
|
||||
<van-button type="primary" @click="show.lightTheme = true">
|
||||
{{ t('lightTheme') }}
|
||||
</van-button>
|
||||
<template #reference>
|
||||
<van-button type="primary" @click="show.lightTheme = true">
|
||||
{{ t('lightTheme') }}
|
||||
</van-button>
|
||||
</template>
|
||||
</van-popover>
|
||||
<van-popover
|
||||
v-model="show.darkTheme"
|
||||
@ -18,9 +20,11 @@
|
||||
placement="bottom"
|
||||
style="margin-left: 16px;"
|
||||
>
|
||||
<van-button type="primary" @click="show.darkTheme = true">
|
||||
{{ t('darkTheme') }}
|
||||
</van-button>
|
||||
<template #reference>
|
||||
<van-button type="primary" @click="show.darkTheme = true">
|
||||
{{ t('darkTheme') }}
|
||||
</van-button>
|
||||
</template>
|
||||
</van-popover>
|
||||
</demo-block>
|
||||
|
||||
@ -55,7 +59,9 @@
|
||||
:actions="t('shortActions')"
|
||||
:placement="currentPlacement"
|
||||
>
|
||||
<div class="demo-popover-refer" />
|
||||
<template #reference>
|
||||
<div class="demo-popover-refer" />
|
||||
</template>
|
||||
</van-popover>
|
||||
</div>
|
||||
</demo-block>
|
||||
@ -67,9 +73,11 @@
|
||||
placement="top"
|
||||
style="margin-left: 16px;"
|
||||
>
|
||||
<van-button type="primary" @click="show.showIcon = true">
|
||||
{{ t('showIcon') }}
|
||||
</van-button>
|
||||
<template #reference>
|
||||
<van-button type="primary" @click="show.showIcon = true">
|
||||
{{ t('showIcon') }}
|
||||
</van-button>
|
||||
</template>
|
||||
</van-popover>
|
||||
|
||||
<van-popover
|
||||
@ -78,9 +86,11 @@
|
||||
placement="top"
|
||||
style="margin-left: 16px;"
|
||||
>
|
||||
<van-button type="primary" @click="show.disabled = true">
|
||||
{{ t('disabled') }}
|
||||
</van-button>
|
||||
<template #reference>
|
||||
<van-button type="primary" @click="show.disabled = true">
|
||||
{{ t('disabled') }}
|
||||
</van-button>
|
||||
</template>
|
||||
</van-popover>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
|
@ -168,7 +168,7 @@ export default createComponent({
|
||||
<div class={bem('arrow')} />
|
||||
{this.actions.map(this.renderAction)}
|
||||
</Popup>
|
||||
{this.slots('default')}
|
||||
{this.slots('reference')}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user