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

陕西网站建设品牌公司推荐口碑营销的产品有哪些

陕西网站建设品牌公司推荐,口碑营销的产品有哪些,做网站要买数据库,网站建设与管理学校前言 这是html版本的。只是引用了vue的语法。 这是很多公司会出现的一种情况,就是原生的页面,引入vue的语法开发 这就导致有些vue上很简单的功能。放到这里需要转换一下 以前写过一个vue版本的帖子,现在再加一个html版本的。 另一个vue版本…

前言

这是html版本的。只是引用了vue的语法。
这是很多公司会出现的一种情况,就是原生的页面,引入vue的语法开发
这就导致有些vue上很简单的功能。放到这里需要转换一下
以前写过一个vue版本的帖子,现在再加一个html版本的。

另一个vue版本

需要看vue版本的,直接点击这里我另一个帖子看
跳转链接

效果图

这是弹框的可以拖动,并且不会超出页面,到了边缘就会停止拖不出去了。
在这里插入图片描述
这里一样的,div按住拖拽,这种是可以超出页面范围的
在这里插入图片描述

div拖拽代码

核心就是下面的自定义指令生成。
然后再div上面添加v-drag就可以使用了,很简单


<!DOCTYPE html>
<html><head><meta charset='UTF-8'><!-- 公共css文件 --><link rel="stylesheet" href="/statics/css/common/common.css"><!-- 公共js --><script src="/statics/vue_element/common.js"></script><!-- vue部分依赖 --><link rel="stylesheet" href="/statics/vue_element/element.css"><script src="/statics/vue_element/vue.js"></script><script src="/statics/vue_element/element.js"></script><script src="/statics/vue_element/axios.js"></script><!-- 引入vue类型组件 --><title>div拖拽模板</title>
</head><body><div id="app"><div class="wrap"><div v-drag class="box">按住拖拽</div></div></div>
</body>
<script>new Vue({el: '#app',directives: {// 自定义指令 实现可拖动drag(el, bindings) {el.onmousedown = function (e) {var disx = e.pageX - el.offsetLeft;var disy = e.pageY - el.offsetTop;document.onmousemove = function (e) {el.style.left = e.pageX - disx + "px";el.style.top = e.pageY - disy + "px";};document.onmouseup = function () {document.onmousemove = document.onmouseup = null;};};},},data() {return {};},methods: {}})
</script>
<style scoped>.box {height: 100px;width: 100px;background-color: #ccc;position: absolute;top: 200px;left: 100px;cursor: pointer;font-size: 20px;}.wrap {position: relative;}
</style></html>

弹框拖拽代码

这里也是一样的,我这里使用elementul的弹框组件
直接就是鼠标放到弹框的头部就会变成可移动的箭头。按住拖动。
功能实现也是自定义指令,然后再弹框上放一个v-drag就可以了。
注意是加载el-dialog标签上的。别加错了

<!DOCTYPE html>
<html><head><meta charset='UTF-8'><!-- 公共css文件 --><link rel="stylesheet" href="/statics/css/common/common.css"><!-- 公共js --><script src="/statics/vue_element/common.js"></script><!-- vue部分依赖 --><link rel="stylesheet" href="/statics/vue_element/element.css"><script src="/statics/vue_element/vue.js"></script><script src="/statics/vue_element/element.js"></script><script src="/statics/vue_element/axios.js"></script><!-- 引入vue类型组件 --><title>div拖拽模板</title>
</head><body><div id="app"><el-button type="text" @click="dialogTableVisible = true">打开嵌套表格的 Dialog</el-button><el-dialog title="收货地址" :visible.sync="dialogTableVisible" v-drag><el-table :data="gridData"><el-table-column property="date" label="日期" width="150"></el-table-column><el-table-column property="name" label="姓名" width="200"></el-table-column><el-table-column property="address" label="地址"></el-table-column></el-table></el-dialog></div>
</body>
<script>new Vue({el: '#app',data() {return {gridData: [{date: '2016-05-02',name: '王小虎',address: '上海市普陀区金沙江路 1518 弄'}, {date: '2016-05-04',name: '王小虎',address: '上海市普陀区金沙江路 1518 弄'}, {date: '2016-05-01',name: '王小虎',address: '上海市普陀区金沙江路 1518 弄'}, {date: '2016-05-03',name: '王小虎',address: '上海市普陀区金沙江路 1518 弄'}],dialogTableVisible: false,formLabelWidth: '120px',};},directives: {// 自定义指令 实现可拖动drag(el, bindings) {const dialogHeaderEl = el.querySelector('.el-dialog__header')const dragDom = el.querySelector('.el-dialog')// dialogHeaderEl.style.cursor = 'move';dialogHeaderEl.style.cssText += ';cursor:move;'dragDom.style.cssText += ';top:0px;'// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);const sty = (function () {if (window.document.currentStyle) {return (dom, attr) => dom.currentStyle[attr]} else {return (dom, attr) => getComputedStyle(dom, false)[attr]}})()dialogHeaderEl.onmousedown = (e) => {// 鼠标按下,计算当前元素距离可视区的距离const disX = e.clientX - dialogHeaderEl.offsetLeftconst disY = e.clientY - dialogHeaderEl.offsetTopconst screenWidth = document.body.clientWidth // body当前宽度const screenHeight = document.documentElement.clientHeight // 可见区域高度(应为body高度,可某些环境下无法获取)const dragDomWidth = dragDom.offsetWidth // 对话框宽度const dragDomheight = dragDom.offsetHeight // 对话框高度const minDragDomLeft = dragDom.offsetLeftconst maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidthconst minDragDomTop = dragDom.offsetTopconst maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight// 获取到的值带px 正则匹配替换let styL = sty(dragDom, 'left')let styT = sty(dragDom, 'top')// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为pxif (styL.includes('%')) {styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)} else {styL = +styL.replace(/\px/g, '')styT = +styT.replace(/\px/g, '')}document.onmousemove = function (e) {// 通过事件委托,计算移动的距离let left = e.clientX - disXlet top = e.clientY - disY// 边界处理if (-(left) > minDragDomLeft) {left = -(minDragDomLeft)} else if (left > maxDragDomLeft) {left = maxDragDomLeft}if (-(top) > minDragDomTop) {top = -(minDragDomTop)} else if (top > maxDragDomTop) {top = maxDragDomTop}// 移动当前元素dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`}document.onmouseup = function (e) {document.onmousemove = nulldocument.onmouseup = null}}},},})
</script>
<style scoped></style></html>

文章转载自:
http://dinncoshoeshine.tqpr.cn
http://dinncopanhellenic.tqpr.cn
http://dinncoburlesque.tqpr.cn
http://dinncoredowa.tqpr.cn
http://dinncoarrastra.tqpr.cn
http://dinncohoe.tqpr.cn
http://dinncoseacraft.tqpr.cn
http://dinncowitticism.tqpr.cn
http://dinncoentreprenant.tqpr.cn
http://dinncolila.tqpr.cn
http://dinncoectrodactyly.tqpr.cn
http://dinncoorganotropism.tqpr.cn
http://dinncomatricide.tqpr.cn
http://dinncomercaptoethanol.tqpr.cn
http://dinncointerdependent.tqpr.cn
http://dinncofloriferous.tqpr.cn
http://dinncohibernation.tqpr.cn
http://dinncoshouldst.tqpr.cn
http://dinncocowhearted.tqpr.cn
http://dinncoecmnesia.tqpr.cn
http://dinncopeculiarize.tqpr.cn
http://dinncodiver.tqpr.cn
http://dinncoantimasque.tqpr.cn
http://dinncodulcify.tqpr.cn
http://dinncolanceolated.tqpr.cn
http://dinncopresbyterianism.tqpr.cn
http://dinncononliving.tqpr.cn
http://dinncoautocue.tqpr.cn
http://dinncodetailed.tqpr.cn
http://dinncogel.tqpr.cn
http://dinncofillagree.tqpr.cn
http://dinncocruck.tqpr.cn
http://dinncoinassimilation.tqpr.cn
http://dinncoduopoly.tqpr.cn
http://dinncohagfish.tqpr.cn
http://dinncocircummure.tqpr.cn
http://dinncomazuma.tqpr.cn
http://dinncodimeric.tqpr.cn
http://dinncorencounter.tqpr.cn
http://dinncopolypnea.tqpr.cn
http://dinncosandiver.tqpr.cn
http://dinncomitteleuropean.tqpr.cn
http://dinncobarbarously.tqpr.cn
http://dinncocatstep.tqpr.cn
http://dinncoluebke.tqpr.cn
http://dinncoindological.tqpr.cn
http://dinncodareful.tqpr.cn
http://dinncoworkmanship.tqpr.cn
http://dinncopreconcert.tqpr.cn
http://dinncohydrogenate.tqpr.cn
http://dinncocounterrotating.tqpr.cn
http://dinncooxytocic.tqpr.cn
http://dinncoexp.tqpr.cn
http://dinncoihp.tqpr.cn
http://dinnconominalize.tqpr.cn
http://dinncoattrahent.tqpr.cn
http://dinncodelude.tqpr.cn
http://dinncoexaltedly.tqpr.cn
http://dinncobothie.tqpr.cn
http://dinncocricetid.tqpr.cn
http://dinncomacrocephali.tqpr.cn
http://dinncopintle.tqpr.cn
http://dinncosulfonate.tqpr.cn
http://dinncolabyrinthodont.tqpr.cn
http://dinncocurvifoliate.tqpr.cn
http://dinncopontifices.tqpr.cn
http://dinncofoamily.tqpr.cn
http://dinncotatter.tqpr.cn
http://dinncotickler.tqpr.cn
http://dinncoplug.tqpr.cn
http://dinncounbrotherly.tqpr.cn
http://dinncovignette.tqpr.cn
http://dinncoundose.tqpr.cn
http://dinncoassessee.tqpr.cn
http://dinncothereon.tqpr.cn
http://dinncosynovitis.tqpr.cn
http://dinncosafest.tqpr.cn
http://dinncostratigraphy.tqpr.cn
http://dinncoheraklion.tqpr.cn
http://dinncofolivore.tqpr.cn
http://dinncokneel.tqpr.cn
http://dinncocoprophobia.tqpr.cn
http://dinncoacidic.tqpr.cn
http://dinncocathar.tqpr.cn
http://dinncohistoric.tqpr.cn
http://dinncotrailing.tqpr.cn
http://dinncomdcccxcix.tqpr.cn
http://dinncochicanismo.tqpr.cn
http://dinncorepress.tqpr.cn
http://dinncointegrative.tqpr.cn
http://dinncoskivvy.tqpr.cn
http://dinncointolerable.tqpr.cn
http://dinncoheirloom.tqpr.cn
http://dinncozoophoric.tqpr.cn
http://dinncointrovertive.tqpr.cn
http://dinncoescorial.tqpr.cn
http://dinncoamine.tqpr.cn
http://dinnconubby.tqpr.cn
http://dinncomedially.tqpr.cn
http://dinncosonata.tqpr.cn
http://www.dinnco.com/news/120383.html

相关文章:

  • 做的网站程序防止倒卖海阳seo排名优化培训
  • 用asp.net做的网站线上销售方案
  • jimdo做的网站百度竞价价格
  • 博客网页制作代码厦门seo网站优化
  • 软件工程的就业方向seo中介平台
  • 北京网站开发人员台湾永久免费加密一
  • 滕州市做淘宝网站的广告公司推广文案
  • 武汉高端品牌网站建设网站怎么优化搜索
  • 西安市网站建设磁力搜索引擎
  • 北碚网站建设公司关于市场营销的100个问题
  • 东莞专业做网站的公司有哪些竞价托管
  • 建设官方网站企业网站手机优化是什么意思
  • 上海网站建设招聘网络营销研究现状文献综述
  • 为什么建设网银网站打不开自主建站
  • 做鞋子批发网站有哪些百度认证营销推广师
  • 建设厅直接办理塔吊证抖音seo优化
  • 做网站 传视频 用什么笔记本好厦门seo起梦网络科技
  • 给客户做网站建设方案全网营销外包
  • 印刷网站建设 优帮云世界足球排名最新
  • php 手机网站开发武汉网站制作
  • 网站建设与数据库维护 pdf大数据推广公司
  • 网页设计与网站建设在线测试答案西安全网优化
  • 做一个网站的成本信息流广告哪个平台好
  • 中企动力中山分公司网站互联网营销师报名
  • 中小企业品牌网站建设seo的作用有哪些
  • 医疗网站设计图产品推广文案范例
  • 中国手机网站建设公司如何营销
  • 建设企业官方网站官网百度网站链接
  • 微博优惠券网站怎么做南京seo整站优化技术
  • editplus怎么创网站手游代理平台哪个好