tyh-ui2
Version:
The next generation ui component library of tyh-ui is based on vue3 Version, fully embrace vue3.
2 lines (1 loc) • 1.29 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("./index2.js"),a={class:"tyh-three"},h=["onClick"],d={class:"tyh-three-label-text"},u={key:0,class:"tyh-three-children"},_=e.defineComponent({name:"TyhTree"}),p=e.defineComponent({..._,props:i.Props,setup(v){const t=e.ref(!1),l=o=>{o.children&&o.children.length&&(t.value=!t.value)};return(o,m)=>{const c=e.resolveComponent("tyh-icon"),r=e.resolveComponent("tyh-tree");return e.openBlock(),e.createElementBlock("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(n,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"tyh-three-list"},[e.createElementVNode("div",{class:"tyh-three-label",onClick:y=>l(n)},[e.createVNode(c,{icon:"tyh-ui-arrow-right-filling",color:"#c0c4cc",class:e.normalizeClass([{"tyh-three-icon":t.value}])},null,8,["class"]),e.createElementVNode("span",d,e.toDisplayString(n.label),1)],8,h),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[n.children?e.withDirectives((e.openBlock(),e.createElementBlock("div",u,[e.createVNode(r,{data:n.children},null,8,["data"])],512)),[[e.vShow,t.value]]):e.createCommentVNode("",!0)]),_:2},1024)]))),128))])}}});exports.default=p;