UI组件库Kendo UI for Angular入门指南教程 - Button(按钮)
Kendo UI for Angular的按钮组件提供了具有任意内容的可点击UI功能。
安装
使用快速设置 (Angular CLI) 或手动添加包。
使用 Angular CLI 进行快速设置
Angular CLI 支持通过 ng add 命令添加包,该命令一步执行一组其他单独需要的命令。
ng add @progress/kendo-angular-buttons
手动设置
您在安装过程中引用的所有组件都将出现在应用程序的最终包中。
为避免最终使用您实际上不需要的组件,请执行以下任一操作:
- 使用 ButtonsModule 一次性导入所有 Buttons 组件
- 通过将特定的 Buttons 组件添加为单独的 NgModule 来导入它。
1. 下载并安装软件包。
npm install --save @progress/kendo-angular-buttons @progress/kendo-angular-l10n @progress/kendo-angular-popup @progress/kendo-angular-common @progress/kendo-licensing
2. 安装后,导入所需组件的 NgModule。
要获取所有包组件,请在应用程序根或功能模块中导入 ButtonsModule。
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ButtonsModule } from '@progress/kendo-angular-buttons'; import { AppComponent } from './app.component'; @NgModule({ bootstrap: [AppComponent], declarations: [AppComponent], imports: [BrowserModule, BrowserAnimationsModule, ButtonsModule] }) export class AppModule { }
该包还为各个组件导出以下模块:
- ButtonModule
- ButtonGroupModule
- ChipModule
- DropDownButtonModule
- FloatingActionButtonModule
- SplitButtonModule
要减小应用程序的大小,请仅包含您需要的模块。
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; // Imports the Button module import { ButtonModule } from '@progress/kendo-angular-buttons'; // Imports the ButtonGroup module import { ButtonGroupModule } from '@progress/kendo-angular-buttons'; @NgModule({ bootstrap: [AppComponent], declarations: [AppComponent], imports: [ BrowserModule, BrowserAnimationsModule, ButtonModule, ButtonGroupModule ] }) export class AppModule { }
3. 您需要为Angular安装Kendo UI主题来设置组件样式。
4. 按照 Kendo UI for Angular My License 页面上的说明激活您的许可证,如果您的应用程序已包含 Kendo UI 许可文件,则可以跳过此步骤。
依赖关系
Buttons 包要求您在应用程序中安装以下对等依赖项:
- @angular/common
- @angular/core
- @progress/kendo-angular-l10n
- @progress/kendo-angular-popup
- @progress/kendo-angular-common
- @progress/kendo-licensing
- rxjs
Buttons包利用了Angular动画系统,它支持一组特定的浏览器。
Kendo UI for Angular是Kendo UI系列商业产品的最新产品。Kendo UI for Angular是专用于Angular开发的专业级Angular组件。telerik致力于提供纯粹的高性能Angular UI组件,无需任何jQuery依赖关系。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
2020-09-10 DevExpress ASP.NET v20.1界面开发新版亮点:Pivot Grid等控件全新升级
2019-09-10 Kendo UI for jQuery使用教程:使用MVVM初始化(二)