vuetifyjs/vuetify

[Feature Request] Slot `placeholder` for `VTextarea`

Open

#20,886 建立於 2025年1月20日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (40,995 star) (7,139 fork)batch import
C: VFieldC: VTextareaT: featuregood first issue

描述

Problem to solve

v-textarea has a template slot for label which is useful to customize the label.

My current use case is to have a smooth transition if the label changes based on previous user input:

<v-textarea v-model="inputMessage">
  <template #label>
    <v-fade-transition mode="out-in">
      <div :key="inputMessageLabel">{{ inputMessageLabel }}</div>
    </v-fade-transition>
  </template>
</v-textarea>

inputMessageLabel changes based on previous user input.

This is cool, but that type of changing message would better be placed as a placeholder. Unfortunately I can't use a transition in the placeholder like I'm doing here, because there's no slot for it.

Proposed solution

Have a slot for placeholder that works analog to the slot for label

貢獻者指南