fix: modal update config not work

pull/2682/head
tangjinzhou 4 years ago
parent 515d90513c
commit 1eb76e2300

@ -1 +1 @@
Subproject commit 7edb9609894a10324fc71095b197f64bddb98795
Subproject commit 4b4c51535a790c0b06818d5d17f973148d8e65db

@ -12,14 +12,20 @@ export default function confirm(config) {
let confirmDialogInstance = null;
let confirmDialogProps = {};
function close(...args) {
destroy(...args);
currentConfig = {
...currentConfig,
visible: false,
afterClose: destroy.bind(this, ...args),
};
update(currentConfig);
}
function update(newConfig) {
currentConfig = {
...currentConfig,
...newConfig,
};
Object.assign(confirmDialogInstance, currentConfig);
confirmDialogInstance &&
Object.assign(confirmDialogInstance, { confirmDialogProps: currentConfig });
}
function destroy(...args) {
if (confirmDialogInstance && div.parentNode) {

@ -51,6 +51,7 @@ let cacheOverflow = {};
export default {
name: 'VcDialog',
mixins: [BaseMixin],
inheritAttrs: false,
props: initDefaultProps(IDialogPropTypes, {
mask: true,
visible: false,
@ -261,12 +262,10 @@ export default {
</button>
);
}
const style = dest;
const { style: stl, class: className } = this.$attrs;
const style = { ...stl, ...dest };
const sentinelStyle = { width: 0, height: 0, overflow: 'hidden' };
const cls = {
[prefixCls]: true,
};
const cls = [prefixCls, className, dialogClass];
const transitionName = this.getTransitionName();
const dialogElement = (
<LazyRenderBox
@ -275,7 +274,7 @@ export default {
role="document"
ref="dialog"
style={style}
class={[cls, dialogClass]}
class={cls}
forceRender={forceRender}
onMousedown={this.onDialogMouseDown}
>

@ -4,7 +4,7 @@
</div>
</template>
<script>
import demo from '../antdv-demo/docs/list/demo/index';
import demo from '../antdv-demo/docs/modal/demo/index';
export default {
components: {

@ -176,7 +176,7 @@
},
"dependencies": {
"@ant-design-vue/babel-helper-vue-compatible-props": "^1.0.0",
"@ant-design/icons-vue": "^5.0.0-beta.0",
"@ant-design/icons-vue": "^5.0.0",
"@babel/runtime": "^7.10.5",
"@simonwep/pickr": "~1.7.0",
"add-dom-event-listener": "^1.0.2",

Loading…
Cancel
Save