vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
2 lines (1 loc) • 1.77 kB
JavaScript
"use strict";const e=require("vue"),k=require("./hook/useRate.cjs"),c=require("@vuux/icons"),d=["onMousemovePassive","onClick","onTouchendPassive"],h=e.defineComponent({name:"Rate",__name:"index",props:{modelValue:{default:0},length:{default:5},readonly:{type:Boolean},size:{default:22},color:{default:"#ffb800"},heart:{type:Boolean}},emits:["update:modelValue","select"],setup(s,{emit:f}){const o=s,m=f,u=e.useTemplateRef("rateEl"),{onTouchMove:v,onMousemove:p,onMouseleave:a,handleAction:i,getIconType:t}=k.useRate(o,u,m);return(z,l)=>(e.openBlock(),e.createElementBlock("div",{class:"app-rate",ref_key:"rateEl",ref:u,onMouseleave:l[1]||(l[1]=(...n)=>e.unref(a)&&e.unref(a)(...n))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.length,n=>(e.openBlock(),e.createElementBlock("div",{class:"rate-data",key:n,onMousemovePassive:r=>e.unref(p)(n),onClick:r=>e.unref(i)(n),onTouchendPassive:r=>e.unref(i)(n),onTouchmovePassive:l[0]||(l[0]=r=>e.unref(v)(r))},[o.heart?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createVNode(e.unref(c.Icon),{name:"Icon2043232",size:o.size,color:o.color},null,8,["size","color"]),[[e.vShow,e.unref(t)(n)==="full"]]),e.withDirectives(e.createVNode(e.unref(c.Icon),{name:"Icon8834439",size:o.size,color:o.color},null,8,["size","color"]),[[e.vShow,e.unref(t)(n)!=="full"]])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.withDirectives(e.createVNode(e.unref(c.Icon),{size:o.size,color:o.color,name:"Icon4585273"},null,8,["size","color"]),[[e.vShow,e.unref(t)(n)==="full"]]),e.withDirectives(e.createVNode(e.unref(c.Icon),{name:"Icon9699566",size:o.size,color:o.color},null,8,["size","color"]),[[e.vShow,e.unref(t)(n)!=="full"]])],64))],40,d))),128))],544))}});module.exports=h;