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

天津网站建设58海门网站建设

天津网站建设58,海门网站建设,动态网站制作价格,网上兼职做网站编辑获取当前时间时间戳,返回遵循ISO 8601扩展格式的日期 new Date(Date.now()).toISOString() 使用moment库转换回来 this.moment(new Date(Date.now()).toISOString()).format("YYYY-MM-DD") js去掉富文本中html标签和图片 filterHtmlTag(val) {if(!val){…

 获取当前时间时间戳,返回遵循ISO 8601扩展格式的日期

 new Date(Date.now()).toISOString()

使用moment库转换回来

this.moment(new Date(Date.now()).toISOString()).format("YYYY-MM-DD")

 

 

 

js去掉富文本中html标签和图片

 filterHtmlTag(val) {if(!val){return false;}// 过滤掉富文本中的所有标签var filter = val.replace(/<(p|div)[^>]*>(<br\/?>| )<\/\1>/gi, "\n").replace(/<br\/?>/gi, "\n").replace(/<[^>/]+>/g, "").replace(/(\n)?<\/([^>]+)>/g, "").replace(/\u00a0/g, " ").replace(/ /g, " ").replace(/<\/?(img)[^>]*>/gi, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, '"').replace(/<\/?.+?>/g, "");var filterOver =filter.length > 400 ? filter.slice(0, 400) + "..." : filter;return filterOver;},

 控制伪元素的显示隐藏,并且可以对伪元素添加点击事件

我们需要在css做这种处理

父元素添加:pointer-events: none; 伪元素添加:pointer-events: auto;

<div@click="ele.unfoldButton=false"v-html="filterHtmlTag(ele.filterInfo) ||filterHtmlTag(ele.labels[0].value)"class="text-part":class="ele.unfoldButton?'setButton':''"></div>.text-part {height: 115px;background-color: rgb(242, 242, 242);padding: 10px;padding-bottom: 25px;overflow: hidden;position: relative;pointer-events: none;}
.setButton::after {content: "V";position: absolute;pointer-events: auto;font-weight: bold;bottom: 5px;left: 50%;font-size: 20px;color: var(--mainColor);display: inline-block;width: 25px;height: 20px;line-height: 20px;cursor: pointer;border-radius: 50%;margin-right: 5px;margin-left: 5px;text-align: center;}

页面上渲染失败[object Promise]

172c675bcdc140ed826e31e7d1174bf1.png 

 代码里是这样写的

   
{{filterHtmlTag(ele.filterInfo, ele.unfoldButton)}}//改变文字颜色changeWordColor(str, stringPart) {str = str.replace(stringPart,'<span style="color: var(--mainColor);">' + stringPart + "</span>");return str;},async filterHtmlTag(val, slice = false, searchStatus = this.openSearch) {if (!val) {return false;}// 过滤掉富文本中的所有标签var filter = val.replace(/<(p|div)[^>]*>(<br\/?>| )<\/\1>/gi, "\n").replace(/<br\/?>/gi, "\n").replace(/<[^>/]+>/g, "").replace(/(\n)?<\/([^>]+)>/g, "").replace(/\u00a0/g, " ").replace(/ /g, " ").replace(/<\/?(img)[^>]*>/gi, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, '"').replace(/<\/?.+?>/g, "");// 是否折叠var filterOver =filter.length > 400 ? filter.slice(0, 400) + "..." : filter;//如果是搜索状态if (searchStatus) {filterOver =this.changeWordColor(filterOver, this.propertyValue);filter = this.changeWordColor(filter, this.propertyValue);}return slice ? filterOver : filter;},

最发现是方法中我写了async,这方法变成异步了,所以才这样输出了,所以啊兄弟们没用的东西一定要删了,使用的时候获取实时的数据,别用async,即可解决此异常

 将elementui的tab切换与走马灯结合起来

04396a56532c4ae69a4709c0e7f2933b.png

 

  <el-tabs v-model="activeItemId" @tab-click="handleClick"><!-- 循环 --><el-tab-pane label="111" name="1"> <el-carouselv-if="ele.dbValueVOS && ele.dbValueVOS.length !== 0"ref="marquee"@change="val => setContentInfo(val, index)"trigger="click"height="150px"indicator-position="none":autoplay="false"arrow="always"><el-carousel-itemv-for="item in ele.dbValueVOS":key="item.id"><h4>{{ item.propertyName }}</h4></el-carousel-item></el-carousel></el-tab-pane>
</el-tabs>handleClick(tab, event) {// 点击tab切换,给走马灯部分指定下标
this.$refs.marquee[0].setActiveItem(this.activeItemId);//  // 将tab的下标指定为走马灯的下标// this.active = e // tab切换的下标//获取列表console.log(tab, event);},

 

修改JS数组中的一个对象的元素的值,其他对象的元素值都跟着变了

数组改完相应下标的的对象,其他下标数据也变了

使用$set给数组里的对象赋值,也改变了其他对象

vue $set 给数组集合对象赋值影响到其他元素

vue数据改变影响其他数据的问题

vue 变量赋值变量,两个变量就会互相影响

vue只是给一条数据赋值却影响到了其他数据

  setContentInfo(valIndex, parentIndex) {var {propertyValue} = this.reportList[parentIndex].dbValueVOS[valIndex];// TODO:给对象中的值赋值,走马灯切换后显示// this.$set(this.reportList[parentIndex], "filterInfo", propertyValue);},

离大谱了,就是个普通赋值,方法只调了一次,就算指定只给下标为0的数据赋值也影响到了其他数据

颠覆我的认知了,科学不存在了

 

 

解决方法如下,直接深拷贝一条,去给数组相应下标的整个对象替换

  setContentInfo(valIndex, parentIndex) {var {propertyValue} = this.reportList[parentIndex].dbValueVOS[valIndex];let realData =JSON.parse(JSON.stringify(this.reportList[parentIndex]));realData.filterInfo=propertyValue;// TODO:给对象中的值赋值,走马灯切换后显示// this.$set(this.reportList[parentIndex], "filterInfo", propertyValue);this.$set(this.reportList, parentIndex, realData);},

 

 


文章转载自:
http://uncordial.sfwd.cn
http://sickly.sfwd.cn
http://sonometer.sfwd.cn
http://amaretto.sfwd.cn
http://yammer.sfwd.cn
http://flee.sfwd.cn
http://jawp.sfwd.cn
http://exhilarant.sfwd.cn
http://flockpaper.sfwd.cn
http://lamb.sfwd.cn
http://reviver.sfwd.cn
http://vasculature.sfwd.cn
http://oleum.sfwd.cn
http://chilean.sfwd.cn
http://cellist.sfwd.cn
http://popped.sfwd.cn
http://potty.sfwd.cn
http://meleager.sfwd.cn
http://incondensable.sfwd.cn
http://adverb.sfwd.cn
http://renavigate.sfwd.cn
http://ophthalmitis.sfwd.cn
http://swimfeeder.sfwd.cn
http://maccabean.sfwd.cn
http://isothermal.sfwd.cn
http://schoolmate.sfwd.cn
http://measure.sfwd.cn
http://mips.sfwd.cn
http://octavo.sfwd.cn
http://allow.sfwd.cn
http://dresser.sfwd.cn
http://communicative.sfwd.cn
http://embolden.sfwd.cn
http://extrication.sfwd.cn
http://visibility.sfwd.cn
http://fathership.sfwd.cn
http://dementia.sfwd.cn
http://seoul.sfwd.cn
http://spiracle.sfwd.cn
http://dicynodont.sfwd.cn
http://nitrocellulose.sfwd.cn
http://pica.sfwd.cn
http://roadlouse.sfwd.cn
http://dicephalous.sfwd.cn
http://nephelometer.sfwd.cn
http://solidary.sfwd.cn
http://kosciusko.sfwd.cn
http://zapu.sfwd.cn
http://aerobacteriological.sfwd.cn
http://caernarvon.sfwd.cn
http://agraphia.sfwd.cn
http://soundful.sfwd.cn
http://waterflooding.sfwd.cn
http://wholesaler.sfwd.cn
http://sightsinging.sfwd.cn
http://parle.sfwd.cn
http://intercomparable.sfwd.cn
http://blueweed.sfwd.cn
http://delia.sfwd.cn
http://prepreference.sfwd.cn
http://exclamation.sfwd.cn
http://raucousness.sfwd.cn
http://apologetics.sfwd.cn
http://fiddlefucking.sfwd.cn
http://diaper.sfwd.cn
http://meagre.sfwd.cn
http://hypochondrium.sfwd.cn
http://dragon.sfwd.cn
http://malleability.sfwd.cn
http://tatterdemalion.sfwd.cn
http://laibach.sfwd.cn
http://elenctic.sfwd.cn
http://hypophloeodal.sfwd.cn
http://endotracheal.sfwd.cn
http://curtly.sfwd.cn
http://ophiuroid.sfwd.cn
http://jeopardousness.sfwd.cn
http://adjutantship.sfwd.cn
http://kechumaran.sfwd.cn
http://mercapto.sfwd.cn
http://panmixis.sfwd.cn
http://autoformat.sfwd.cn
http://interpretative.sfwd.cn
http://palearctic.sfwd.cn
http://karyotype.sfwd.cn
http://glumpy.sfwd.cn
http://inlaut.sfwd.cn
http://expositorial.sfwd.cn
http://untender.sfwd.cn
http://isograph.sfwd.cn
http://ennead.sfwd.cn
http://protectory.sfwd.cn
http://finch.sfwd.cn
http://corpse.sfwd.cn
http://trilobed.sfwd.cn
http://transparent.sfwd.cn
http://longe.sfwd.cn
http://chlorine.sfwd.cn
http://swellhead.sfwd.cn
http://capaneus.sfwd.cn
http://www.hrbkazy.com/news/91888.html

相关文章:

  • 菏泽网站建设价位seo怎么读
  • 建设网站 买了域名还要什么代运营是什么意思
  • 多产品网站怎么做企业网站百度正版下载
  • 鄂尔多斯网站网站建设微信附近人推广引流
  • 新上市手机seo搜索优化软件
  • html5微网站demo百度权重查询工具
  • 网站建设标准简约优化模型有哪些
  • 厦门装修公司网站建设seo图片优化
  • 查网站的建站系统竞价推广托管
  • 宝安做小程序有推荐吗推广优化排名
  • 做网站代理seo站长综合查询
  • 建湖人才网最新招聘信息查询电池优化大师下载
  • 做玉的网站怎么创建网站的快捷方式
  • 网站 做实名认证百度竞价开户流程
  • 网站开发宣传方法郑州seo线上推广系统
  • 哪些网站可以做招商广告北大青鸟培训机构靠谱吗
  • 网站建设优化服务新闻专注于品牌营销服务
  • 怎么在自己的电脑上做网站深圳网络营销平台
  • 网站做任务 炸金花什么是优化设计
  • 商城型网站的概念网络营销是什么
  • 辽宁企业网站建设公司成都网站seo设计
  • 全渠道营销管理平台seo 优化思路
  • 制作图网站有哪些内容杭州网站seo推广软件
  • 网站建设移动端是什么意思网络推广公司排名
  • 做网站可行性分析网站优化外包
  • 深圳网站建设 案例新闻头条最新消息
  • wordpress导入b站视频教程google谷歌
  • 模板型网站建设灰色行业seo大神
  • 做网站一般用什么框架搜索引擎优化大致包含哪些内容或环节
  • 高仿做的最好的网站网络营销培训机构