VUE——关闭框

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/HarryHY/article/details/102486533

点击其他区域关闭

    //关闭
    clickout(event) {
      //  this.giftflag = false
      let outDiv = document.getElementById("giftbox");
      if (outDiv) {
        if (!outDiv.contains(event.target)) {
          this.giftflag = false;
        }
      }
    },

猜你喜欢

转载自blog.csdn.net/HarryHY/article/details/102486533