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>

 

posted @ 2024-01-16 17:12  易先讯  阅读(47)  评论(0编辑  收藏  举报