UNPKG

ant-design-x-vue-next

Version:

Ant Design X for Vue — community continuation aligned with @ant-design/x

2 lines (1 loc) 949 B
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=e.defineComponent({name:"AXXMarkdownAnimationText",__name:"AnimationText",props:{text:null,animationConfig:null},setup(l){const r=l,o=e.ref([]),t=e.ref("");e.watch(()=>r.text,n=>{if(n===t.value)return;if(!(t.value&&n.indexOf(t.value)===0)){o.value=[n],t.value=n;return}const a=n.slice(t.value.length);a&&(o.value=[...o.value,a],t.value=n)},{immediate:!0});const u=e.computed(()=>{const{fadeDuration:n=200,easing:a="ease-in-out"}=r.animationConfig||{};return{animation:`x-markdown-fade-in ${n}ms ${a} forwards`,color:"inherit"}});return(n,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(i,s)=>(e.openBlock(),e.createElementBlock("span",{key:`${s}-${i.slice(0,8)}`,class:"x-markdown-animation-text",style:e.normalizeStyle(u.value)},e.toDisplayString(i),5))),128))}});exports.default=c;