Feat: #11
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
<label :for="id">{{ label }}</label>
|
<label :for="id">{{ label }}</label>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
|
@input="resize"
|
||||||
|
rows="1"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@@ -31,8 +33,6 @@
|
|||||||
background-color: var(--bg-sub-color);
|
background-color: var(--bg-sub-color);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
resize: vertical;
|
|
||||||
field-sizing: content;
|
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
outline: none;
|
outline: none;
|
||||||
padding: 0.6rem;
|
padding: 0.6rem;
|
||||||
@@ -58,4 +58,9 @@ defineProps<{
|
|||||||
|
|
||||||
const model = defineModel<string>();
|
const model = defineModel<string>();
|
||||||
const id = useId();
|
const id = useId();
|
||||||
|
|
||||||
|
const resize = (event: any) => {
|
||||||
|
event.target.style.height = "auto";
|
||||||
|
event.target.style.height = event.target.scrollHeight + 'px';
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user