UI組件庫Kendo UI for Angular入門指南教程 - Button(按鈕)

Kendo UI for Angular的按鈕組件提供了具有任意內容的可點擊UI功能。

Kendo UI for Angular最新版工具下載

安裝

使用快速設置 (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 for Angular是Kendo UI系列商業產品的最新產品。Kendo UI for Angular是專用於Angular開發的專業級Angular組件。telerik致力於提供純粹的高性能Angular UI組件,無需任何jQuery依賴關係。


瞭解最新Kendo UI最新資訊,請關注Telerik中文網!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章