element icon indicating copy to clipboard operation
element copied to clipboard

[Bug Report] When the visible property of the <el-dialog> is set without the.Sync modifier, the closing fork on the upper right corner of the dialog is invalid

Open qidaneix opened this issue 9 years ago • 6 comments

Element UI version

1.4.6

OS/Browsers version

windows 7/chrome

Vue version

2.4.4

Reproduction Link

https://jsfiddle.net/xiaodabao/ph15ksbc/3/

Steps to reproduce

点击按钮,再点击dialog的×

What is Expected?

弹窗关闭

What is actually happening?

弹窗未能关闭

qidaneix avatar Oct 10 '17 06:10 qidaneix

Translation of this issue:

Element UI version

1.4.6

OS/Browsers version

Windows 7/chrome

Vue version

2.4.4

Reproduction Link

https://jsfiddle.net/xiaodabao/ph15ksbc/3/

Steps to reproduce

Click the button, and then click dialog *

What is Expected?

Pop off

What is actually happening?

Popups failed to close

element-bot avatar Oct 10 '17 06:10 element-bot

设计上就是这样的。

wacky6 avatar Oct 10 '17 06:10 wacky6

@wacky6 有什么办法可以解决吗,因为有时候这个:visible的属性值可能是从父组件props传递来的,加上.sync属性的话vue会报错。 或许隐藏组件的关闭按钮,自定义一个关闭按钮是个选择?

qidaneix avatar Oct 10 '17 06:10 qidaneix

看下before-close属性,你应该在回调里面修改父组件的值。

wacky6 avatar Oct 10 '17 06:10 wacky6

问题解决了,通过隐藏关闭按钮然后自定义关闭按钮的方式。 @wacky6 谢谢

qidaneix avatar Oct 11 '17 02:10 qidaneix

看你的例子,当你点击关闭按钮时,没有改变dialogTableVisible的值,它仍然时true,这时否需要使用.sync,来更新值。

https://jsfiddle.net/j9tka548/

upangka avatar Dec 30 '19 08:12 upangka