mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 01:17:15 +00:00
chore(Popover): change name of default slot to reference
This commit is contained in:
@@ -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>
|
||||
);
|
||||
},
|
||||
|
Reference in New Issue
Block a user