vue-drawer
<template>
<div>
<DrawerComponent />
</div>
</template>
<script>
import DrawerComponent from './Drawer.vue'
export default {
components: {
DrawerComponent
}
}
</script>
<template> <el-button @click="drawer = true">打开抽屉</el-button> <el-drawer v-model="drawer" title="Hello world" :before-close="handleClose"> <span>这是一段信息</span> </el-drawer> </template> <script> import { ref } from 'vue' import { ElDrawer, ElButton } from 'element-plus' export default { components: { [ElDrawer.name]: ElDrawer, [ElButton.name]: ElButton }, setup() { const drawer = ref(false) const handleClose = (done) => { done() } return { drawer, handleClose } } } </script>
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/17968114