layui/src/module/textarea/index.vue

22 lines
533 B
Vue
Raw Normal View History

2021-09-28 04:41:16 +00:00
<template>
<textarea :value="modelValue" :placeholder="placeholder" :name="name" class="layui-textarea" @input="updateValue"></textarea>
</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
const props =
defineProps<{
name?: string
modelValue?: string
placeholder?: string
}>()
const emit = defineEmits(['update:modelValue'])
const updateValue = function(event: InputEvent) {
emit('update:modelValue', (event.target as HTMLInputElement).value)
}
</script>