提交 7677b05d authored 作者: 王鹏飞's avatar 王鹏飞

feat: 增加默认显示的属性;增加显示类型的属性;增加 Dialog 关闭回调事件;

上级 2f074c5b
# Changelog
### 0.1.5(2020-01-20)
- 增加默认显示的属性 `visible`
- 增加显示类型的属性 `show-type`
- 增加 Dialog 关闭回调事件 `@close`
### 0.1.4(2020-01-06)
- 新增注册模块
......
......@@ -54,6 +54,10 @@ export default {
## 属性
```javascript
visible: true,
showType: 1, // 0 注册,1登录,2找回密码
options: {
// 注册
register: {
......@@ -104,5 +108,6 @@ options: {
## 事件
| 事件名 | 返回值 | 说明 |
| ------- | -------------------------- | ---------- |
| ------- | -------------------------- | ----------------- |
| `ready` | function(isLogin, user) {} | 组件初始化 |
| `close` | - | Dialog 关闭的回调 |
{
"name": "@ezijing/vue-passport",
"version": "0.1.4",
"version": "0.1.5",
"description": "基于Vue Element-UI的登录注册",
"main": "dist/vue-passport.umd.min.js",
"keywords": [
......
<template>
<el-dialog class="ezijing-dialog" width="420px" :visible.sync="dialogVisible" :show-close="false">
<el-dialog
class="ezijing-dialog"
width="420px"
:visible.sync="dialogVisible"
:show-close="false"
@close="$emit('close')"
>
<components
:is="activeComponent"
v-bind="componentProps"
......@@ -27,12 +33,28 @@ export default {
default() {
return {}
}
}
},
visible: { type: Boolean, default: false },
showType: { type: Number, default: 0 }
},
data() {
return {
dialogVisible: true,
openType: 0
dialogVisible: this.visible,
openType: this.showType
}
},
watch: {
visible: {
immediate: true,
handler(value) {
this.dialogVisible = value
}
},
showType: {
immediate: true,
handler(value) {
this.openType = value
}
}
},
computed: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论