vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
2 lines (1 loc) • 2.7 kB
JavaScript
"use strict";const e=require("vue"),_=require("./hook/useTour.cjs"),v=require("@vuux/icons"),E={key:0,class:"app-tour"},B={key:0,class:"tour-svg"},V=["d"],N={class:"step-data"},y={class:"step-details"},C={class:"step-title"},h={class:"step-content"},S={class:"step-foot"},g={key:0,class:"step-dots"},x={key:1},b={class:"step-buts"},w=e.defineComponent({name:"Tour",__name:"index",props:{modelValue:{type:Boolean},data:{default:()=>[]},buts:{default:()=>({next:"下一步",prev:"上一步",end:"完成"})}},emits:["update:modelValue","ok","close"],setup(u,{emit:i}){const t=u,d=i,{state:o,stepEl:m,arrowEl:p,stepCount:r,computedPath:k,handleClose:f,handleNext:l,handlePrev:c}=_.useTour(t,d);return(T,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"tour-mask"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",E,[e.unref(o).isShowSvg?(e.openBlock(),e.createElementBlock("svg",B,[e.createElementVNode("path",{d:e.unref(k)},null,8,V)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1}),t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stepEl",ref:m,class:"app-tour-step"},[e.createElementVNode("div",N,[e.createElementVNode("div",{class:e.normalizeClass(["step-arrow",{"is-top":e.unref(o).isTop,"is-bottom":e.unref(o).isBottom}]),ref_key:"arrowEl",ref:p},null,2),e.createVNode(e.unref(v.Icon),{name:"Icon9176904",class:"is-close",size:14,onClick:n[0]||(n[0]=s=>e.unref(f)("close"))}),e.createElementVNode("div",y,[e.unref(r)>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",C,e.toDisplayString(t.data[e.unref(o).currentStep].title),1),e.createElementVNode("div",h,e.toDisplayString(t.data[e.unref(o).currentStep].content),1)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",S,[e.unref(r)>1?(e.openBlock(),e.createElementBlock("div",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:e.normalizeClass(["dots-item",{"is-active":a===e.unref(o).currentStep}])},null,2))),128))])):(e.openBlock(),e.createElementBlock("span",x)),e.createElementVNode("div",b,[e.unref(o).currentStep>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"is-prev",onClick:n[1]||(n[1]=(...s)=>e.unref(c)&&e.unref(c)(...s))},e.toDisplayString(t.buts.prev||"上一步"),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"is-next",onClick:n[2]||(n[2]=(...s)=>e.unref(l)&&e.unref(l)(...s))},e.toDisplayString(e.unref(o).currentStep!==e.unref(r)-1?t.buts.next||"下一步":t.buts.end),1)])])])],512)):e.createCommentVNode("",!0)],64))}});module.exports=w;