36751e5b by 任超

style:弹窗

1 parent b58dc9af
export default {
SERVERAPI: '/service-bdcdj-Tian',
SERVERCAI: '/service-bdcdj-Tian'
SERVERAPI: '/service-bdcdj9',
// SERVERCAI: '/service-bdcdj-Tian'
}
\ No newline at end of file
......
......@@ -13,5 +13,4 @@ Popup.install = function (title, editItem, data) {
instance.isShow = true
})
}
export default Popup
\ No newline at end of file
export default Popup
......
......@@ -55,21 +55,21 @@ export default {
},
mounted () {
// 计算滚动条高度
// setTimeout(() => {
// if (this.btnShow) {
// if (this.height == 'auto') {
// this.contentHeight = (this.$refs.contentRef.offsetHeight - 200) + 'px'
// } else {
// this.contentHeight = this.height
// }
// } else {
// if (this.height == 'auto') {
// this.contentHeight = this.$refs.contentRef.offsetHeight
// } else {
// this.contentHeight = this.height
// }
// }
// }, 500)
setTimeout(() => {
if (this.btnShow) {
if (this.height == 'auto') {
this.contentHeight = (this.$refs.contentRef.offsetHeight - 200) + 'px'
} else {
this.contentHeight = this.height
}
} else {
if (this.height == 'auto') {
this.contentHeight = this.$refs.contentRef.offsetHeight
} else {
this.contentHeight = this.height
}
}
}, 300)
},
methods: {
onCancel () {
......@@ -78,12 +78,12 @@ export default {
},
onConfirm () {
this.loading = true
let isOk = this.$refs.childRef.childFn() //子组件方法 必须命名一致
if (isOk || isOk == undefined) { //如果子组件没有 return false 就代表子组件方法一切正常
this.isShow = false
let res = new Promise((resolve, reject) => {
this.confirm()
} else { //否则
console.log('弹窗不关闭')
resolve(true)
})
if (res) {
this.isShow = false
}
},
loadingFn (e) { //加载状态
......@@ -93,7 +93,7 @@ export default {
return (r) =>
require.ensure([], () =>
r(require(`@/views/${view}.vue`))
);
)
}
},
destroyed () {
......@@ -146,6 +146,8 @@ export default {
.ls-mask-content {
padding: 20px;
width: 100%;
min-height: 30%;
max-height: 95%;
overflow: scroll;
}
......
弹窗封装
2.用法以及参数:
this.$popup('提示','ywbl/dbx/aa',{
formData:this.formData, //父组件传给子组件的参数
cancel: function () {}, //取消事件的回调
confirm: function () {}, //确认事件的回调
})
3.子组件的方法名字必须统一为 childFn()
4.子组件切记props接收 父组件传参formData
以及在使用结束后传loading状态给父组件
this.$popup('提示','ywbl/dbx/aa',{
width: '75%', // 初始化75% 不需要改的话 可以直接不要
formData: this.formData, //父组件传给子组件的参数
cancel: function () {}, //取消事件的回调 没有按钮可以不需要
confirm: function () {} //确认事件的回调 没有按钮可以不需要
})
5.后续有修改请添加在此处文档说明作用
\ No newline at end of file
......
......@@ -111,15 +111,8 @@ export default {
moreQueryClick () { },
openDialog (scroll) {
this.$popup('登记簿详情', 'registerBook/djbFrame', {
formData: scroll,
width: "1220px",
height: "790px",
cancel: () => {
console.log("取消回调");
},
confirm: () => {
console.log("确认回调");
},
width: '90%',
formData: scroll
});
},
handleLpbClick (item) {
......