el-dialog 允许操作底部按钮
时间: 2023-06-28 14:04:59 浏览: 60
是的,el-dialog 组件允许在底部添加操作按钮。你可以通过设置 `footer-slot` 属性来实现。具体的做法是在 el-dialog 组件中添加一个具有 `slot="footer"` 的元素,然后在该元素中添加需要的按钮组件即可。例如:
```html
<el-dialog title="提示" :visible.sync="dialogVisible" :modal="false" :close-on-click-modal="false">
<span>这是一段消息</span>
<template slot="footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSomething()">确定</el-button>
</template>
</el-dialog>
```
在上面的例子中,我们在 el-dialog 组件中添加了一个具有 `slot="footer"` 的 `<template>` 元素,并在其中添加了两个 el-button 组件。这样就可以在 el-dialog 底部添加操作按钮了。