primevue-mirror/apps/showcase/doc/datatable/pt/PTViewer.vue

37 lines
1023 B
Vue
Raw Permalink Normal View History

2023-05-04 08:33:59 +00:00
<template>
2024-09-13 14:23:27 +00:00
<DocPTViewer :docs="docs">
<DataTable :value="products" tableStyle="min-width: 50rem">
<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>
</DocPTViewer>
2023-05-04 08:33:59 +00:00
</template>
2024-09-13 14:23:27 +00:00
<script>
import { getPTOptions } from '@/components/doc/helpers';
import { ProductService } from '@/service/ProductService';
export default {
data() {
return {
products: null,
docs: [
{
data: getPTOptions('DataTable'),
key: 'DataTable'
},
{
data: getPTOptions('Column'),
key: 'Column'
}
]
};
},
mounted() {
ProductService.getProductsMini().then((data) => (this.products = data));
}
};
</script>