首页 > 其他分享 >InBody 组件 将dom挂载到body

InBody 组件 将dom挂载到body

时间:2023-11-08 09:56:36浏览次数:27  
标签:body node const dom durationStr test animationNode duration InBody

<template>
  <div>
      
    <transition v-bind:name="transName" appear>
      <slot></slot>
    </transition>

  </div>
</template>

<script>

export default {
  data() {
    return {
      transName: 'test',
    }
  },
  mounted() {
    const node = this.$mount().$el
    document.body.appendChild(node)
  },
  
  destroyed() {
    const node = this.$mount().$el
    const animationNode = node.children[0];
    animationNode.classList.add(`${this.transName}-leave-to`)
    animationNode.classList.add(`${this.transName}-leave-active`)

    const computedStyle = window.getComputedStyle(animationNode).transitionDuration;
    const durationStr = computedStyle.transitionDuration;

    let duration;
    if (/ms$/g.test(durationStr)) {
      duration = parseFloat(durationStr)
    } else if (/s$/g.test(durationStr)) {
      duration = parseFloat(durationStr) * 1000
    }
    
    setTimeout(() => {
      node.remove();
    }, duration);
  }
}
</script>

标签:body,node,const,dom,durationStr,test,animationNode,duration,InBody
From: https://www.cnblogs.com/7c89/p/17816660.html

相关文章

  • @RequestBody接收Json参数 用自定义注解对Vo对象中Date类型日期格式校验
    @RequestBody接收Json参数|用自定义注解对Vo对象中Date类型日期格式校验问题描述昨天测试的同事测试接口的时候,测试出来一个Date类型校验问题。要求输入的日期格式是:yyyy-MM-ddHH:mm:ss,Vo中使用的注解如下:@DateTimeFormat(pattern=”yyyy-MM-ddHH:mm:ss”)测试同事输入下面两种......
  • 2023CVPR_Efficient Frequency Domain-based Transformers for High-Quality Image De
    一.Motivation1.Transformer在解决全局表现很好,但是复杂度很高,主要体现在QK的乘积:(Wenotethatthescaleddot-productattentioncomputationisactuallytoestimatethecorrelationofonetokenfromthequeryandallthetokensfromthekey)在self-attention中......
  • SecureRandom随机数引起的故障
    故障现象:接口大面积超时(数十秒到十多分钟不等)、接口大面积报错(比如连接池报错);常见监控如JVM、数据库连接、SQL查询、网络、请求量都没有异常。问题分析:问题开始于修复Sonar问题publicclassMathUtils{/***根据长度,生成指定位数的随机数*/publi......
  • 白屏时间first paint和可交互时间dom ready的关系是先触发first paint ,后触发dom read
    页面的性能指标详解:白屏时间(firstPaintTime)——用户从打开页面开始到页面开始有东西呈现为止首屏时间——用户浏览器首屏内所有内容都呈现出来所花费的时间用户可操作时间(domInteractive)——用户可以进行正常的点击、输入等操作,默认可以统计domready时间,因为通常会在这时......
  • Domino for Young
    题目给出了一张杨表,要求你能够放上去的最多的骨牌数量。证明看这里。只能说妙蛙!补充一些题解认为显然的证明。任何一张网格图(相邻的点视作有边),按照\(i+j\)(下标)的奇偶性划分,可以证明这是一张二分图(有点显然)。\(\forall(x,y),color(x+1,y)\neqcolor(x,y),...\),因为相邻格子......
  • RandomPaintingOnABoard TopCoder - 12607
    AnoteabouttheconstraintsConstraintsindicateusthatthemaximumwidthandheightwillbe21.Thereisanotherconstraintthough:Themaximumtotalnumberofcellsis150.Thiscanhelpusbecauseitmeansthatthesmallerdimensionwillbeatmost1......
  • spring boot aop 中获取requestbody参数
    packagecom.xkcoding.log.aop.aspectj;importjava.io.BufferedReader;importjava.io.IOException;importjava.util.Map;importjava.util.Objects;importjavax.servlet.http.HttpServletRequest;importorg.aspectj.lang.JoinPoint;importorg.aspectj.lang.Pr......
  • [ARC104E] Random LIS 题解
    题意给定一个长度为\(N\)的序列\(A\),按照下列方式生成一个长度为\(N\)的序列\(X\):\(\foralli\in[1,n]\),\(X_i\)在\([1,A_i]\)中的整数中均匀随机生成。求其最长上升子序列长度的期望,对\(10^9+7\)取模。\(1\leN\le6,1\leA_i\le10^9\)。题解由于\(N\)......
  • RequestBody 和 RequestParam的区别
    @RequestBody,需要使用传入json格式,专门为了application/json和application/xml等设置的会自动装配到实体类中代码@RequestMapping(value="test3",method=RequestMethod.POST)publicvoidtest3(@RequestBodyUserDtouserDto){//from-data......
  • Java流程控制_05 Random
     指定区间: 97-100 ----》0-3  ----》r.nextInt(4)+97  1、RandomRandomr=newRandom();inta=r.nextInt(10);2、 ScannerScannersc=newScanner(System.in);System.out.println("");//打印一段提示信息intage=sc.nextInt();//等待键盘输入 ......