[新增] textarea 组件

This commit is contained in:
就眠仪式
2021-09-28 12:41:16 +08:00
parent af7f672852
commit 0a664e5b47
4 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
<template>
<textarea :value="modelValue" :placeholder="placeholder" :name="name" class="layui-textarea" @input="updateValue"></textarea>
</template>
<script setup name="LayTextarea" lang="ts">
import { defineProps, defineEmits } from '@vue/runtime-core'
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>