We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0.0-rc.2
macOS/Chrome 53
2.0.0-rc.6
null
<div class="div1" v-if="show" v-clickoutside="out1"></div> <div class="div2" v-if="show" v-clickoutside="out2"></div>
execute:
show = false sleep 100 show = true sleep 100 show = false sleep 100 show = true ...
Now click outside div1 and div2
out1 and out2 will execute only once.
out1
out2
out1 and out2 execute many times.
https://github.com/ElemeFE/element/blob/master/src/utils/clickoutside.js
用一个全局的变量 handler 存储 addEventListener 是有问题的。
handler
在 Vue1 中,可以通过 this 访问 Directive 对象,而 Vue2 不行,目前能想到的处理方法是把实例数据挂到当前节点上。
The text was updated successfully, but these errors were encountered:
确实是,忽略这问题了
Sorry, something went wrong.
No branches or pull requests
ElementUI version
1.0.0-rc.2
OS/Browers version
macOS/Chrome 53
Vue version
2.0.0-rc.6
Reproduction Link
null
Steps to reproduce
execute:
Now click outside div1 and div2
What is Expected?
out1
andout2
will execute only once.What is actually happening?
out1
andout2
execute many times.https://github.com/ElemeFE/element/blob/master/src/utils/clickoutside.js
用一个全局的变量
handler
存储 addEventListener 是有问题的。在 Vue1 中,可以通过 this 访问 Directive 对象,而 Vue2 不行,目前能想到的处理方法是把实例数据挂到当前节点上。
The text was updated successfully, but these errors were encountered: