翻譯|使用教程|編輯:龔雪|2021-07-19 10:12:10.660|閱讀 429 次
概述:利用DevExtreme可快速構建交互式的Web應用程序,本文主要介紹如何創建一個DevExtreme應用,歡迎下載最新版體驗~
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
如果您從頭開始創建一個項目,可使用DevExtreme Angular模板,這是一個簡單的應用程序,帶有導航菜單和響應式布局中的幾個示例視圖()。
您可以使用DevExtreme CLI 生成此應用程序:
npx -p devextreme-cli devextreme new angular-app app-name cd app-name npm run start
該應用程序已經包含 DataGrid 和 Form UI 組件,可以在src\pages\display-data\display-data.component.html 和 src\pages\profile\profile.component.html 文件中分別找到它們的配置。以下說明以 Button UI 組件為例展示了如何使用其他DevExtreme UI 組件:
1. 在將要使用它的 NgModule 中導入DevExtreme UI 組件的模塊,打開 src\app\app-routing.module.ts 文件并添加以下代碼:
app-routing.module.ts
// ... import { ..., DxButtonModule } from 'devextreme-angular'; @NgModule({ imports: [ ..., DxButtonModule ], // ... }) export class AppModule { }
2. 在標記中配置 DevExtreme UI 組件,將以下代碼添加到 src\app\pages\home\home.component.html 文件中:
home.component.html
<!-- ... --> <dx-button text="Click me" (onClick)="helloWorld()"> </dx-button> <!-- ... -->
3. 在應用程序類中聲明回調函數、事件處理程序和綁定屬性。 在這個例子中,我們在 src\app\pages\home\home.component.ts 文件中聲明了 onClick 事件處理程序:
home.component.ts
// ... export class AppComponent { helloWorld() { alert('Hello world!'); } }
如果您在瀏覽器中轉到主頁視圖,您應該會看到按鈕。
DevExtreme擁有高性能的HTML5 / JavaScript小部件集合,使您可以利用現代Web開發堆棧(包括React,Angular,ASP.NET Core,jQuery,Knockout等)構建交互式的Web應用程序。從Angular和Reac,到ASP.NET Core或Vue,DevExtreme包含全面的高性能和響應式UI小部件集合,可在傳統Web和下一代移動應用程序中使用。 該套件附帶功能齊全的數據網格、交互式圖表小部件、數據編輯器等。
DevExpress技術交流群4:715863792 歡迎一起進群討論
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都網