<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>
标签:vue,ElButton,drawer,export,import,ElDrawer From: https://www.cnblogs.com/gongxianjin/p/17968114