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

医院网站建设怎么样淘宝推广软件

医院网站建设怎么样,淘宝推广软件,wordpress 角色和权限管理,做网站 写文章怎样加视频发现nextTick必须放在修改一个响应式数据之后,才会在onUpdated之后被调用,如果nextTick是放在所有对响应式数据修改之前,则nextTick里面的回调函数会在onBeforeUpdate方法执行前就被调用了。可是nextTick必须等到onUpdated执行完成之后执行&a…
  1. 发现nextTick必须放在修改一个响应式数据之后,才会在onUpdated之后被调用,如果nextTick是放在所有对响应式数据修改之前,则nextTick里面的回调函数会在onBeforeUpdate方法执行前就被调用了。可是nextTick必须等到onUpdated执行完成之后执行,才能拿到渲染得到的dom
  2. 下面发请求的时候是没有使用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---
nextTick2
<template><div style="display: flex;"><ul class="ul-list"><li v-for="i in num" :id="'li'+i" >{{ i }}</li></ul><div class="div-desc"><input type="text" v-model="n"><button @click="handleClick">修改num</button><br><br><button @click="toggleColor">切换span颜色</button><span ref="spanRef" :style="{color:colorRef}">span</span>*{{ serverResp }}*<button v-if="isShow" ref="btnRef">dd</button></div></div></template><script lang="ts" setup>import { ref,reactive,onBeforeMount,onMounted,onBeforeUpdate,onUpdated,nextTick,getCurrentInstance } from 'vue'const { 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---')})</script><style lang="scss">.ul-list {width: 100px;}.div-list { width: 300px;}
</style>

在这里插入图片描述

http://www.mmbaike.com/news/68363.html

相关文章:

  • 有什么做兼职的医疗网站关键seo排名点击软件
  • 企业电话号码大全关键词排名优化公司哪家强
  • 传送门网站是怎么做的深圳网站推广公司
  • wordpress注册页面404seo推广策划
  • WordPress做的网站源代码企业网站建设报价
  • 网站停留时间 从哪里获取西安网站优化培训
  • 济南网站建设jnwuyi西安楼市最新房价
  • wordpress4.9.4下载百度seo提高排名费用
  • wordpress响应式网站seo关键词排行优化教程
  • 建设网站的软件刚刚中国突然宣布
  • 哪个网站做童装批发小程序开发平台
  • 山东省建设厅官方网站怎么样企业seo推广
  • 日本亲子游哪个网站做的好微信推广方式有哪些
  • 福州专业网站建设推广费用网站被禁用如何解决
  • 西安十强互联网站建设公司最有效的网络推广方式和策略
  • 免费的网站服务器网站优化seo方案
  • 漯河做网站xknt上海排名优化推广工具
  • 有友情链接的网站网站页面怎么优化
  • 网站设计的技术选择seo排名优化什么意思
  • 东莞网络做推广公司seo自然搜索优化排名
  • 赶集网天津网站建设百度推广代理商利润
  • 北京网站建设有限公司每天新闻早知道
  • 怎么建设网站是什么武汉seo引擎优化
  • 石家庄手机网站制作多少钱网站制作推广电话
  • 东莞高端网站建设收费标准北京网站优化seo
  • 上海最专业的网站建设公司排名互联网营销
  • 网络公司企业网站模板关键字排名软件官网
  • easy wordpress timelines上海seo网站优化
  • php做网站csdn保定网站建设公司哪家好
  • 外国平面设计网站有哪些深圳外贸网络推广