mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
46 lines
910 B
Vue
46 lines
910 B
Vue
<template>
|
||
<div>
|
||
<VPopup v-if="isPopup" v-model="popup" :trigger-element="$refs.popupButton" auto-destroy>
|
||
<slot />
|
||
</VPopup>
|
||
<DefaultWidget v-if="isPopup" ref="popupButton" :icon="icon" @click="popup = !popup">
|
||
<span>{{ title }}</span>
|
||
</DefaultWidget>
|
||
|
||
<slot v-if="!isPopup" />
|
||
</div>
|
||
</template>
|
||
|
||
<script lang="ts">
|
||
import { DefaultWidget, VPopup } from '@/ui'
|
||
|
||
export default Vue.extend({
|
||
components: {
|
||
DefaultWidget,
|
||
VPopup,
|
||
},
|
||
props: {
|
||
/** 是否弹出显示,false:直接显示内容,true:显示一个按钮,点击弹出显示内容 */
|
||
isPopup: {
|
||
type: Boolean,
|
||
required: true,
|
||
},
|
||
/** 按钮标题 */
|
||
title: {
|
||
type: String,
|
||
required: true,
|
||
},
|
||
/** 按钮Icon */
|
||
icon: {
|
||
type: String,
|
||
default: '',
|
||
},
|
||
},
|
||
data() {
|
||
return {
|
||
popup: false,
|
||
}
|
||
},
|
||
})
|
||
</script>
|