admin 管理员组文章数量: 887021
2024年1月12日发(作者:开源程序受法律保护吗)
// ('V3Layer is now [%s]', val ? 'show' : 'hide') if(val) { open(); }else { close(); } }) // 打开弹窗 const open = () => { if() return; = true; typeof ess === 'function' && ess(); const dom = ; // 弹层挂载位置 if(rt) { nextTick(() => { let teleportNode = elector(rt); Child(dom); auto(); }) } callback(); } // 关闭弹窗 const close = () => { if(!) return; let dom = ; let vlayero = elector('.vlayer__wrap'); let ocnt = elector('.vlayer__wrap-cntbox'); let omax = elector('.vlayer__maximize'); ls = true; clearTimeout($closeTimer); $closeTimer = setTimeout(() => { = false; ls = false; if(roll) { $locknum--; if(!$locknum) { gRight = ''; ('vui__body-hidden'); } } if() { $index--; } // 清除弹窗样式 = = = = ''; = ''; omax && ns('maximized') && ('maximized');
Overflow && (ow = ''); ('update:modelValue', false); typeof === 'function' && (); }, 200) } // 弹窗位置
const auto = () => { // ... autopos(); // 全屏弹窗 if(reen) { full(); } // 弹窗拖动|缩放 move(); } const autopos = () => { if(!) return; let oL, oT let pos = on; let isFixed = (); let dom = ; let vlayero = elector('.vlayer__wrap'); if(!isFixed || ) { on = 'absolute'; }
let area = [('width'), ('height'), Width, Height]
oL = (area[0] - area[2]) / 2; oT = (area[1] - area[3]) / 2; if() { offset(); }else { typeof pos === 'object' ? ( oL = parseFloat(pos[0]) || 0, oT = parseFloat(pos[1]) || 0 ) : ( pos == 't' ? oT = 0 :
pos == 'r' ? oL = area[0] - area[2] :
pos == 'b' ? oT = area[1] - area[3] :
pos == 'l' ? oL = 0 :
pos == 'lt' ? (oL = 0, oT = 0) :
pos == 'rt' ? (oL = area[0] - area[2], oT = 0) :
pos == 'lb' ? (oL = 0, oT = area[1] - area[3]) : pos == 'rb' ? (oL = area[0] - area[2], oT = area[1] - area[3]) :
null ) = parseFloat(isFixed ? oL : ('left') + oL) + 'px'; = parseFloat(isFixed ? oT : ('top') + oT) + 'px'; } } // 元素跟随定位 const offset = () => { let oW, oH, pS let dom = let vlayero = elector('.vlayer__wrap'); oW = Width; oH = Height; pS = lowRect(, oW, oH); ow = pS[2];
= pS[0] + 'px';
版权声明:本文标题:vue3.0pc网页端弹窗vue3自定义dialog、modal组件 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1705054282h471379.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论