@demacia/ngx-textarea-auto-height
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

angular 文本域根据内容自动适应高度插件

📦 安装

npm install @demacia/ngx-textarea-auto-height --save

🔨 使用

引入module

import { TextareaAutoHeightModule } from '@demacia/ngx-textarea-auto-height';

@NgModule({
    imports: [
        TextareaAutoHeightModule
    ]
})
export class AppModule {
}

在 textarea 标签上使用

<textarea autoHeight></textarea>

🎨 API

1. @Input() 属性

  • maxHeight 最大高度(px),超出限制后不再增加高度,而是显示滚动条

  • minHeight 最小高度(px),低于限制后不再减少高度

2. @Output() 属性

  • sizeChange 高度变化事件,参数为当前 textarea 高度

Package Sidebar

Install

npm i @demacia/ngx-textarea-auto-height

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

89.7 kB

Total Files

24

Last publish

Collaborators

  • zw277856645