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

桓台建设网站网站建设方案

桓台建设网站,网站建设方案,wordpress外贸企业模板,红色网站 后台发现nextTick必须放在修改一个响应式数据之后#xff0c;才会在onUpdated之后被调用#xff0c;如果nextTick是放在所有对响应式数据修改之前#xff0c;则nextTick里面的回调函数会在onBeforeUpdate方法执行前就被调用了。可是nextTick必须等到onUpdated执行完成之后执行才会在onUpdated之后被调用如果nextTick是放在所有对响应式数据修改之前则nextTick里面的回调函数会在onBeforeUpdate方法执行前就被调用了。可是nextTick必须等到onUpdated执行完成之后执行才能拿到渲染得到的dom下面发请求的时候是没有使用async的(Promise的语法糖)它里面的then函数对serverRef的修改会再一次触发组件重新渲染也就是onBeforeUpdate和onUpdated又被回调了一次也就是说下面的toggleColor这个方法触发了2次渲染。 ---onBeforeMounted--- RefImpl {__v_isShallow: false, dep: undefined, __v_isRef: true, _rawValue: null, _value: null} ---mounted--- RefImpl {__v_isShallow: false, dep: undefined, __v_isRef: true, _rawValue: span, _value: span} halo world ---onBeforeUpdate--- ---onUpdated--- RefImpl {__v_isShallow: false, dep: undefined, __v_isRef: true, _rawValue: button, _value: button} nextTick1 res ojbk ---onBeforeUpdate--- ---onUpdated--- nextTick2templatediv styledisplay: flex;ul classul-listli v-fori in num :idlii {{ i }}/li/uldiv classdiv-descinput typetext v-modelnbutton clickhandleClick修改num/buttonbrbrbutton clicktoggleColor切换span颜色/buttonspan refspanRef :style{color:colorRef}span/span*{{ serverResp }}*button v-ifisShow refbtnRefdd/button/div/div/templatescript langts setupimport { ref,reactive,onBeforeMount,onMounted,onBeforeUpdate,onUpdated,nextTick,getCurrentInstance } from vueconst { proxy } getCurrentInstance()let num ref(10)let n ref(10)const btnRef ref(null)let isShow ref(false)let serverResp ref()const spanRef ref(null)const handleClick () {num.value parseInt(n.value)}const colorRef ref()const toggleColor () {debuggerproxy.Request({url:http://localhost:8083/test}).then(res{debuggerconsole.log(res,res);serverResp.value resnextTick((){ // 要放在对响应式数据修改之后debuggerconsole.log(nextTick2);})})debuggerisShow.value truenextTick((){ // 要放在对至少一个响应式数据修改之后// 否则这里函数调用将拿不到btnRef,必须要等到onUpdated回调之后执行nextTick里面的回调才能拿到btnRefdebuggerconsole.log(btnRef); console.log(nextTick1);})if(colorRef.value red) {colorRef.value blue} else {colorRef.value red}num.value num.value - 1debuggerconsole.log(halo world);}onBeforeMount(() {console.log(---onBeforeMounted---)console.log(spanRef);})onMounted((){console.log(---mounted---)console.log(spanRef);spanRef.value.style.color cyan}) onBeforeUpdate((){debuggerconsole.log(---onBeforeUpdate---)})onUpdated((){debuggerconsole.log(---onUpdated---)})/scriptstyle langscss.ul-list {width: 100px;}.div-list { width: 300px;} /style
http://www.hyszgw.com/news/88664.html

相关文章:

  • 建设能源官方网站网站1g空间多大
  • 电力建设期刊网站企微管家
  • 做网站怎么做多少钱网站建设与维护 课件
  • 广东品牌网站建设平台贷款做网站
  • 太原网站建设维护网站服务器如何做热备价
  • 商城网站有什么好处lnmp wordpress ftp
  • 做网站太累深圳集团网站建设案例
  • 双流县规划建设局网站wordpress构建企业网站
  • 什么叫网站建设服务wordpress免费英文主题
  • asp网站制作免费模板下载苏州网页设计费用
  • 为什呢网站打开wordpress很慢短剧小程序开发
  • 个人做网站模版是否有人买html遇到的问题及解决方法
  • 贵州省住房和城乡建设厅网网站首页网络营销的有形层
  • 邢台提供网站建设公司电话网站制作公司去哪找客户
  • 个人网站论文结束语WordPress Demo演示
  • 网站建设前准备工作小型企业网站开发价格
  • 金融网站建设方法拍摄宣传片
  • 网站301重定向网站 部署 域名
  • 苏州资讯网站建设品牌建设规划品牌意向
  • 六枝网站建设东莞市赢网网络科技有限公司
  • 查询网站所有关键词排名大宗商品交易平台软件排行
  • 海拉尔网站建设重庆网站建设帝维科技
  • 南通优普高端网站建设电子商务网站的建设流程图
  • 对于职业规划做的好的网站推广网站建设
  • 网站添加广告源码闵行区企业服务平台
  • 绍兴建站服务网站 标签导航
  • 中国空间站对接成功微信公众号的激活方法
  • 做测评的网站网站建设甲方给乙方的需求方案
  • 企业网站推广的收获与启示wordpress经常打不开
  • 网站建设与管理中专专业防止服务器上的网站被进攻