primevue-mirror/pages/datatable/Basic.vue

48 lines
1.4 KiB
Vue
Raw Normal View History

2022-09-09 20:41:18 +00:00
<template>
<div>
<div class="content-section introduction">
<div class="feature-intro">
<h1>DataTable <span>Basic</span></h1>
<p>DataTable requires a collection to display along with column components for the representation of the data.</p>
</div>
<AppDemoActions />
</div>
<div class="content-section implementation">
<div class="card">
<DataTable :value="products" responsiveLayout="scroll">
<Column field="code" header="Code"></Column>
<Column field="name" header="Name"></Column>
<Column field="category" header="Category"></Column>
<Column field="quantity" header="Quantity"></Column>
</DataTable>
</div>
</div>
<DataTableBasicDoc />
</div>
</template>
<script>
import ProductService from '@/service/ProductService';
2022-09-09 20:41:18 +00:00
import DataTableBasicDoc from './DataTableBasicDoc';
export default {
data() {
return {
products: null
};
},
productService: null,
created() {
this.productService = new ProductService();
},
mounted() {
this.productService.getProductsSmall().then((data) => (this.products = data));
},
components: {
DataTableBasicDoc
}
};
</script>