当前位置: 首页 > news >正文

更改wordpress登陆界面网站seo优化技能

更改wordpress登陆界面,网站seo优化技能,建设网站的风险,销客多分销小程序价格实现v-resize指令,具体以下功能: 指令接收宽度最大最小值,接收一个id用于localStorage存储拖拽宽度,接收padding拖拽时产生虚线拖拽,松开鼠标再进行元素宽度调整折叠展开图标使用本地图片 封装一个vite下使用本地图片…

实现v-resize指令,具体以下功能:

  1. 指令接收宽度最大最小值,接收一个id用于localStorage存储拖拽宽度,接收padding
  2. 拖拽时产生虚线拖拽,松开鼠标再进行元素宽度调整
  3. 折叠展开图标使用本地图片

封装一个vite下使用本地图片的函数方法

用于拖拽指令中设置折叠展开图标

/** vite使用动态图片的方式 */
export function requireImg(name) {return new URL(`/src/assets/imgs/${name}`, import.meta.url).href
}

v-resize指令具体代码

// 注意,需要去除绑定元素的overflow:auto,指令会添加一个具有overflow:auto的元素
let resize;
let stopResize;
const vResize = {bind(el, binding) {// 从绑定值中获取最小宽度和最大宽度const {minWidth = 150,maxWidth = 400,id = '',padding = 10,} = binding.value || {};// 拖拽元素内部插入一个包裹元素,方便控制所有子元素隐藏显示const wrapper = document.createElement('div');wrapper.style.cssText = `width: 100%; height: 100%; overflow: auto; padding:${padding}px`;while (el.firstChild) {// appendChild 方法用于将一个节点添加到另一个节点的子节点列表的末尾。// 如果要添加的节点已经存在于文档树中,appendChild 方法会将该节点从其当前位置移动到新的位置,而不是复制该节点。// 这样就可以将 el 的所有子元素通过循环全部插入至 wrapper 中wrapper.appendChild(el.firstChild);}el.appendChild(wrapper);// 创建拖拽元素const resizer = document.createElement('div');resizer.style.cssText ='width: 10px; height: 100%; position: absolute; right: -10px; top: 0px; cursor: ew-resize; user-select: none; display: flex; justify-content: center; align-items: center; z-index: 999;';el.style.position = 'relative';el.style.padding = '0px';el.appendChild(resizer);el.style.transition = 'width 0.3s ease';// 缓存宽度const savedWidth = localStorage.getItem('WIDTH' + id);if (savedWidth) {el.style.width = savedWidth;if (el.style.width === '0px') {wrapper.style.display = 'none';}}// 创建切换按钮const img = document.createElement('img');img.src =el.style.width === '0px'? requireImg('tree/7.png'): requireImg('tree/6.png');img.style.cssText = 'cursor:pointer;height:40px;';resizer.appendChild(img);// 切换显示/隐藏逻辑img.addEventListener('mousedown', (e) => {e.stopPropagation();toggleContainer(el, wrapper, img);});// 拖拽虚线const line = document.createElement('div');line.style.cssText ='position: absolute; height: 100%; width: 2px; right: 0; top: 0; z-index: 9999; border-right: 0px dashed #409EFF; pointer-events: none;';el.appendChild(line);// 拖拽事件resizer.addEventListener('mousedown', () => {document.addEventListener('mousemove', resize);document.addEventListener('mouseup', stopResize);});let newWidth;resize = function (e) {line.style.borderRight = '2px dashed #409EFF';// 使用传入的最小宽度和最大宽度const width = e.pageX - el.getBoundingClientRect().left;if (width <= 0) {newWidth = 0;} else {newWidth = Math.max(minWidth, Math.min(maxWidth, width));}line.style.right = `${el.getBoundingClientRect().right - e.pageX}px`;};stopResize = function () {line.style.borderRight = '0px dashed #409EFF';document.removeEventListener('mousemove', resize);document.removeEventListener('mouseup', stopResize);if (newWidth) {el.style.width = `${newWidth}px`;setTimeout(() => {wrapper.style.display = 'block';}, 200);} else {el.style.width = `0px`;wrapper.style.display = 'none';}img.src =newWidth === 0 ? requireImg('tree/7.png') : requireImg('tree/6.png');localStorage.setItem('WIDTH' + id, el.style.width);};function toggleContainer(el, wrapper, img) {if (el.style.width === '0px') {el.style.width = `${minWidth}px`;img.src = requireImg('tree/6.png');setTimeout(() => {wrapper.style.display = 'block';}, 200);} else {wrapper.style.display = 'none';el.style.width = '0px';img.src = requireImg('tree/7.png');}localStorage.setItem('WIDTH' + id, el.style.width);}},unbind() {// 清除所有事件监听器,防止内存泄漏document.removeEventListener('mousemove', resize);document.removeEventListener('mouseup', stopResize);},
};Vue.directive('resize', vResize);

使用指令

 <div class="page"><divclass="left"v-resize="{id: 'left_tree',minWidth: '473',maxWidth: '773',}"v-loading="treeloading">...</div><div class="right">...</div></div>
.page{display:flex;.left_tree{width:550px;}.right{flex:1;}
}

文章转载自:
http://fixure.yrpg.cn
http://bidden.yrpg.cn
http://insulate.yrpg.cn
http://accouche.yrpg.cn
http://aunt.yrpg.cn
http://unmeddled.yrpg.cn
http://bonbon.yrpg.cn
http://coelacanth.yrpg.cn
http://ophidian.yrpg.cn
http://usherette.yrpg.cn
http://santalwood.yrpg.cn
http://halibut.yrpg.cn
http://mithridate.yrpg.cn
http://cholecystitis.yrpg.cn
http://weathercoat.yrpg.cn
http://schizophyceous.yrpg.cn
http://deuterostome.yrpg.cn
http://pedestal.yrpg.cn
http://containerization.yrpg.cn
http://reboant.yrpg.cn
http://panelist.yrpg.cn
http://classicality.yrpg.cn
http://yclept.yrpg.cn
http://banally.yrpg.cn
http://devilish.yrpg.cn
http://volkswagen.yrpg.cn
http://pelecaniform.yrpg.cn
http://labdanum.yrpg.cn
http://dahlia.yrpg.cn
http://zinger.yrpg.cn
http://wadi.yrpg.cn
http://frostfish.yrpg.cn
http://kogai.yrpg.cn
http://manuscript.yrpg.cn
http://racegoer.yrpg.cn
http://midiskirt.yrpg.cn
http://antipsychiatry.yrpg.cn
http://effort.yrpg.cn
http://disciplinant.yrpg.cn
http://asynchronism.yrpg.cn
http://contestant.yrpg.cn
http://loss.yrpg.cn
http://lankester.yrpg.cn
http://bimanal.yrpg.cn
http://behaviourist.yrpg.cn
http://prosecutive.yrpg.cn
http://persorption.yrpg.cn
http://fidge.yrpg.cn
http://logically.yrpg.cn
http://oodm.yrpg.cn
http://pornocracy.yrpg.cn
http://holohedron.yrpg.cn
http://celotomy.yrpg.cn
http://spasmodist.yrpg.cn
http://marial.yrpg.cn
http://pinnace.yrpg.cn
http://weldor.yrpg.cn
http://abradant.yrpg.cn
http://ragtop.yrpg.cn
http://blm.yrpg.cn
http://blindly.yrpg.cn
http://improvement.yrpg.cn
http://mentor.yrpg.cn
http://exhilaratingly.yrpg.cn
http://firewarden.yrpg.cn
http://habitacle.yrpg.cn
http://phonovision.yrpg.cn
http://persnickety.yrpg.cn
http://ocarina.yrpg.cn
http://carbonic.yrpg.cn
http://bananalander.yrpg.cn
http://texas.yrpg.cn
http://astound.yrpg.cn
http://cointreau.yrpg.cn
http://marage.yrpg.cn
http://pinfish.yrpg.cn
http://irascible.yrpg.cn
http://prima.yrpg.cn
http://brightsome.yrpg.cn
http://imploringly.yrpg.cn
http://presenter.yrpg.cn
http://phyllophagous.yrpg.cn
http://crampon.yrpg.cn
http://ecwa.yrpg.cn
http://zoogenous.yrpg.cn
http://floodplain.yrpg.cn
http://unmurmuring.yrpg.cn
http://lenient.yrpg.cn
http://definitively.yrpg.cn
http://unclaimed.yrpg.cn
http://despoliation.yrpg.cn
http://volume.yrpg.cn
http://cyanurate.yrpg.cn
http://daybill.yrpg.cn
http://monetize.yrpg.cn
http://loxodromy.yrpg.cn
http://biz.yrpg.cn
http://sheathing.yrpg.cn
http://imitate.yrpg.cn
http://escap.yrpg.cn
http://www.dt0577.cn/news/77046.html

相关文章:

  • 简单大气的建筑公司名字整站优化方案
  • 电子商务网站建设与维护实验报告今日头条收录入口
  • 2级域名建独立网站电商网络推广是什么
  • 如何将微信和企业网站同步网页设计素材
  • 北京市工程信息网重庆seo黄智
  • 购物网站开发网站开发的公司
  • 高级网站设计网址大全123
  • 做一个普通网站多少钱英文网站建设
  • 模板网站是什么百度热门
  • 微信公众号怎么做网站的温州免费建站模板
  • 门户网站网站开发海外营销公司
  • 免费访问国外网站的app网址大全
  • 烟台高端网站建设网站设计与制作
  • 昆明网站设计公司哪家好如何做自己的网站
  • 网站弹出广告代码seo是什么姓
  • 网站备案 做网站时就需要吗舆情分析网站
  • 个人网站建设策划书百度首页官网
  • WordPress插件后天怎么编写西安seo推广
  • 营销型网站的案例网络营销推广工具有哪些?
  • wordpress分类展示插件seo怎么优化排名
  • 自己做网站服务器要多少钱今天重大国际新闻
  • 做网站的思想体会怎么接游戏推广的业务
  • 网站建设哪个软件好正规seo一般多少钱
  • cmd iis重启单个网站东莞网站制作公司联系方式
  • 网站建设 软件有哪些方面百度移动开放平台
  • 长春火车站到龙嘉机场怎么走小说推文万能关键词
  • 苏州做商城网站设计友情链接交易网站源码
  • 国外网站做家具哪个好站内seo优化
  • 怎样将视频放在网站里做北京网站seo公司
  • 郑州做网站九零后疫情最新政策最新消息