随笔分类 -  Vue

摘要:<div id="middle" ref="middle" @mousedown="dragMousedown"></div> #middle{ width: 5px; height: 100%; background-color: #d6d6d6; margin-top: -40px; posit 阅读全文
posted @ 2023-02-17 17:24 见贤思“奇” 阅读(154) 评论(0) 推荐(0) 编辑
摘要:1.创建directive.js文件 import Vue from "vue"; // 提交验证 Vue.directive("clickOutside", { // 初始化指令 bind(el, binding, vnode) { function clickHandler(e) { // 这里 阅读全文
posted @ 2022-07-12 10:09 见贤思“奇” 阅读(1414) 评论(0) 推荐(0) 编辑
摘要:// created(创建后) 是 vue 生命周期函数 created() { // 开启监听 // 不起作用的时候在后面加 true 即可 window.addEventListener("resize", this.visibleAreaHeights, true); bus.$on("bus 阅读全文
posted @ 2022-06-23 15:53 见贤思“奇” 阅读(4521) 评论(0) 推荐(0) 编辑
摘要:<div class="self-region" id="self-region">区域</div> document.addEventListener('click', handlerClick) // 监听 document 点击事件 function handlerClick(event) { 阅读全文
posted @ 2022-06-23 15:51 见贤思“奇” 阅读(65) 评论(0) 推荐(0) 编辑
摘要:方法 一//先获取目标位置距离 mounted() { this.$nextTick(() => { setTimeout(() => { let targetbox= document.getElementById('targetbox'); this.target= targetbox.offs 阅读全文
posted @ 2022-06-13 13:39 见贤思“奇” 阅读(1627) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示