弹窗/dialog
使用方式
<template>
<div>
<sp-button type="danger" size="fixed" @click="visible = true">点我显示弹窗</sp-button>
<sp-dialog :visible="visible" @close="dialog()">
<div slot="body">内容/body</div>
<div slot="footer">底部/footer</div>
</sp-dialog>
</div>
</template>
<script>
export default {
data() {
return {
visible: false
}
},
methods: {
dialog() {
this.visible = false;
}
}
}
</script>
sp-dialog
props/属性
参数 |
类型 |
默认值 |
作用 |
visible |
Boolean |
|
必须传递,控制弹窗是否显示 |
title |
String |
Null |
弹窗的标题 |
slot/插槽
slot |
作用 |
body |
弹窗主要区域显示的内容 |
footer |
弹窗底部显示的内容 |
methods/暴露方法