Skip to content

Commit

Permalink
feat(textarea): 新增placeholder-style、placeholder-class属性
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohe0601 committed Feb 21, 2024
1 parent c163817 commit ada249f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/nutui/components/textarea/textarea.ts
Expand Up @@ -30,6 +30,14 @@ export const textareaProps = {
* @description 设置占位提示文字
*/
placeholder: String,
/**
* @description 指定 placeholder 的样式
*/
placeholderStyle: makeStringProp(''),
/**
* @description 指定 placeholder 的样式类
*/
placeholderClass: makeStringProp('textarea-placeholder'),
/**
* @description 只读属性
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/nutui/components/textarea/textarea.vue
Expand Up @@ -149,6 +149,8 @@ export default defineComponent({
:show-count="false"
:maxlength="maxLength ? +maxLength : -1"
:placeholder="placeholder || translate('placeholder')"
:placeholder-style="placeholderStyle"
:placeholder-class="placeholderClass"
:auto-focus="autofocus"
:auto-height="!!autosize"
:cursor-spacing="cursorSpacing"
Expand Down

0 comments on commit ada249f

Please sign in to comment.