2021-09-28 04:41:16 +00:00
|
|
|
<template>
|
2021-10-12 03:30:07 +00:00
|
|
|
<textarea
|
|
|
|
:value="modelValue"
|
|
|
|
:placeholder="placeholder"
|
|
|
|
:name="name"
|
|
|
|
class="layui-textarea"
|
|
|
|
@input="updateValue"
|
|
|
|
/>
|
2021-09-28 04:41:16 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="LayTextarea" lang="ts">
|
2021-09-29 09:22:33 +00:00
|
|
|
import { defineProps, defineEmits } from 'vue'
|
2021-09-28 04:41:16 +00:00
|
|
|
|
2021-10-12 03:30:07 +00:00
|
|
|
const props = defineProps<{
|
|
|
|
name?: string
|
|
|
|
modelValue?: string
|
|
|
|
placeholder?: string
|
|
|
|
}>()
|
2021-09-28 04:41:16 +00:00
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue'])
|
|
|
|
|
2021-10-12 03:30:07 +00:00
|
|
|
const updateValue = function (event: InputEvent) {
|
2021-09-28 04:41:16 +00:00
|
|
|
emit('update:modelValue', (event.target as HTMLInputElement).value)
|
|
|
|
}
|
|
|
|
</script>
|