V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yantianqi
V2EX  ›  程序员

vue 实现点击 document 隐藏 div

  •  
  •   yantianqi · 2017-08-23 13:54:30 +08:00 · 4398 次点击
    这是一个创建于 2442 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Markdown

    iview 链接

    类似图片的功能,自己动手写一个怎么实现?

    4 条回复    2017-08-23 21:46:55 +08:00
    ijse
        1
    ijse  
       2017-08-23 14:05:34 +08:00
    搜索 vue click outside,看源码
    dedmon
        2
    dedmon  
       2017-08-23 14:09:44 +08:00
    airyland
        3
    airyland  
       2017-08-23 14:13:53 +08:00
    写个 click-outside directive 或者引入已有的插件即可

    https://github.com/airyland/vux/blob/v2/src/directives/click-outside/index.js
    leekafai
        4
    leekafai  
       2017-08-23 21:46:55 +08:00 via Android
    :active
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1996 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:21 · PVG 09:21 · LAX 18:21 · JFK 21:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.