ll-package
Version:
6 lines (5 loc) • 1.32 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../../../hooks/useDesign.js"),g=require("../../../../node_modules/ant-design-vue/es/input/TextArea.js");require("../../../../node_modules/ant-design-vue/es/input/index.js");const x=e.defineComponent({name:"LlTextarea"}),w=e.defineComponent({...x,props:{value:{},rows:{default:5},showCount:{type:Boolean},maxlength:{}},emits:["update:value","change"],setup(r,{emit:l}){const{prefixCls:i}=f.useDesign("textarea"),a=r,o=l,n=e.useAttrs(),u=e.ref(""),c=e.computed(()=>n.autoSize?n.autoSize:{minRows:a.rows,maxRows:a.rows}),m=e.computed(()=>({...e.unref(n),...a,autoSize:c.value}));e.watch(()=>a.value,t=>{d(t)},{immediate:!0});function d(t){u.value=t}function p(t){o("update:value",t.target.value),o("change",t.target.value)}return(t,s)=>(e.openBlock(),e.createBlock(e.unref(g.default),e.mergeProps({class:e.unref(i)},m.value,{value:u.value,"onUpdate:value":s[0]||(s[0]=v=>u.value=v),maxlength:a.maxlength,rows:a.rows,onChange:p}),{default:e.withCtx(()=>[e.createTextVNode(`
<template #[item]="data" v-for="item in Object.keys($slots)">
<slot :name="item" v-bind="data || {}" />
</template>
`)]),_:1},16,["class","value","maxlength","rows"]))}});exports.default=w;