|
|
@@ -33,13 +33,26 @@ export default {
|
|
|
);
|
|
|
|
|
|
if (existingDialog) {
|
|
|
- // 用 $set 更新 data/title,保证 Vue 2 响应式
|
|
|
+ // 用 $set 更新 data/title/位置尺寸,保证 Vue 2 响应式
|
|
|
if (config.data !== undefined) {
|
|
|
this.$set(existingDialog, 'data', config.data);
|
|
|
}
|
|
|
if (config.title !== undefined) {
|
|
|
this.$set(existingDialog, 'title', config.title);
|
|
|
}
|
|
|
+ // 允许重入时调整定位/尺寸(如父容器布局变化后重新计算 rect 后传入)
|
|
|
+ if (config.position !== undefined) {
|
|
|
+ this.$set(existingDialog, 'position', config.position);
|
|
|
+ }
|
|
|
+ if (config.width !== undefined) {
|
|
|
+ this.$set(existingDialog, 'width', config.width);
|
|
|
+ }
|
|
|
+ if (config.height !== undefined) {
|
|
|
+ this.$set(existingDialog, 'height', config.height);
|
|
|
+ }
|
|
|
+ if (config.center !== undefined) {
|
|
|
+ this.$set(existingDialog, 'center', config.center);
|
|
|
+ }
|
|
|
existingDialog.visible = true;
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
@@ -53,7 +66,11 @@ export default {
|
|
|
);
|
|
|
|
|
|
if (targetComponent) {
|
|
|
- targetComponent.bringToFront();
|
|
|
+ // 容器型 dialog(bringToFrontOnMousedown=false)走"被动容器"语义,
|
|
|
+ // 重入更新 data 时也不顶 z,避免覆盖在它之上的子 dialog 被遮挡。
|
|
|
+ if (existingDialog.bringToFrontOnMousedown !== false) {
|
|
|
+ targetComponent.bringToFront();
|
|
|
+ }
|
|
|
if (typeof targetComponent.playShake === 'function') {
|
|
|
targetComponent.playShake();
|
|
|
}
|
|
|
@@ -80,6 +97,7 @@ export default {
|
|
|
minWidth: config.minWidth || 200,
|
|
|
minHeight: config.minHeight || 150,
|
|
|
showClose: config.showClose !== false,
|
|
|
+ bringToFrontOnMousedown: config.bringToFrontOnMousedown !== false,
|
|
|
headerComponent: config.headerComponent || null,
|
|
|
headerProps: config.headerProps || {},
|
|
|
data: config.data || {},
|