@neatui/vue 1.2.15 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neatui/vue",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "description": "basic component ui",
5
5
  "main": "./src/index.ts",
6
6
  "license": "MIT",
@@ -6,6 +6,7 @@
6
6
  <div v-if="ready" :ui-form-tips="state.ontips">{{ state.tips }}</div>
7
7
  <slot>
8
8
  <textarea
9
+ ref="el"
9
10
  :rows="rows"
10
11
  v-model="mv"
11
12
  :type="type"
@@ -61,6 +62,11 @@
61
62
  type: Number,
62
63
  default: null
63
64
  },
65
+ // 最小长度
66
+ autoHeight: {
67
+ type: Boolean,
68
+ default: false
69
+ },
64
70
  // 是否禁用
65
71
  disabled: {
66
72
  type: Boolean,
@@ -141,7 +147,6 @@
141
147
  });
142
148
 
143
149
  const mv: any = ref(props.modelValue);
144
-
145
150
  watch(
146
151
  () => props.modelValue,
147
152
  (v: any) => {
@@ -150,6 +155,8 @@
150
155
  },
151
156
  { deep: true, immediate: true }
152
157
  );
158
+ const el: any = ref(null);
159
+ // const rows = ref(1);
153
160
  watch(
154
161
  () => mv.value,
155
162
  (v: any) => {
@@ -159,6 +166,12 @@
159
166
  mv.value = value;
160
167
  }
161
168
  emits('update:modelValue', value);
169
+
170
+ // 自动高度
171
+ if (props.autoHeight) {
172
+ el.value.style.height = 'auto';
173
+ el.value.style.height = el.value.scrollHeight + 'px';
174
+ }
162
175
  },
163
176
  { deep: true }
164
177
  );