翻譯|使用教程|編輯:龔雪|2022-01-25 10:01:17.930|閱讀 349 次
概述:本文主要介紹如何使用DevExtreme的應用程序模板配置主題和身份驗證等,歡迎下載最新版體驗!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
DevExtreme Vue 組件隨 TypeScript 聲明一起提供,Strict類型允許您在早期階段捕獲錯誤并使用代碼完成和自動重構等功能。
以下代碼顯示了在 Vue 應用程序中使用帶有DevExtreme組件的 TypeScript 的示例:
App.vue
<template>
<div>
<DxList :items="items" ref="list">
<template #item="{data}">
<Item :text="data.text" />
</template>
</DxList>
</div>
</template>
<script lang='ts'>
import { Component, Vue } from 'vue-property-decorator';
import { DxList } from 'devextreme-vue/ui/list';
import Item from './components/Item.vue';
interface IListItemProps {
text: string;
}
@Component({
components: {
DxList,
Item
}
})
export default class App extends Vue {
public $refs: Vue['$refs'] & {
list?: DxList,
} = {};
public items: IListItemProps[] = [
{ text: 'Item 1' },
{ text: 'Item 2' },
{ text: 'Item 3' }
];
}
</script>
Item.vue
<template>
<div @click="addCounter">
{{text}} was clicked {{counter}} times
</div>
</template>
<script lang='ts'>
import { Component, Prop, Vue } from 'vue-property-decorator';
@Component
export default class Item extends Vue {
@Prop() public text!: string;
public counter: number = 0;
public addCounter() {
this.counter = this.counter + 1;
}
}
</script>
DevExtreme擁有高性能的HTML5 / JavaScript小部件集合,使您可以利用現代Web開發堆棧(包括React,Angular,ASP.NET Core,jQuery,Knockout等)構建交互式的Web應用程序。從Angular和Reac,到ASP.NET Core或Vue,DevExtreme包含全面的高性能和響應式UI小部件集合,可在傳統Web和下一代移動應用程序中使用。 該套件附帶功能齊全的數據網格、交互式圖表小部件、數據編輯器等。
DevExpress技術交流群5:742234706 歡迎一起進群討論
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn
文章轉載自:慧都網