You need to sign in or sign up before continuing.
index.vue 1.02 KB
<!--
 * @Date: 2022-08-29 14:31:20
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2022-09-08 14:27:56
 * @FilePath: /data-table/src/components/TextareaField/index.vue
 * @Description: 多行文本输入框
-->
<template>
  <div class="textarea-field-page">
    <div class="label">
      {{ item.component_props.label
      }}<span v-if="item.component_props.required">&nbsp;*</span>
    </div>
    <van-field
      v-model="item.value"
      :name="item.name"
      :type="item.type"
      :placeholder="item.component_props.placeholder"
      :rules="item.rules"
      :required="item.component_props.required"
      :rows="item.component_props.rows"
      autosize
      :maxlength="item.component_props.maxlength"
      show-word-limit
    />
  </div>
</template>

<script setup>
const props = defineProps({
  item: Object,
});
</script>

<style lang="less" scoped>
.textarea-field-page {
  .label {
    padding: 1rem 1rem 0 1rem;
    font-size: 0.9rem;
    font-weight: bold;
    span {
      color: red;
    }
  }
}
</style>