You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/popover/demo/control.vue

44 lines
744 B

<docs>
---
order: 3
title:
zh-CN: 从浮层内关闭
en-US: Controlling the close of the dialog
---
## zh-CN
使用 `visible` 属性控制浮层显示
## en-US
Use `visible` prop to control the display of the card.
</docs>
<template>
<a-popover v-model:visible="visible" title="Title" trigger="click">
<template #content>
<a @click="hide">Close</a>
</template>
<a-button type="primary">Click me</a-button>
</a-popover>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const visible = ref<boolean>(false);
const hide = () => {
visible.value = false;
};
return {
visible,
hide,
};
},
});
</script>