2024-04-02 08:38:38 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>For custom content support define an <i>item</i> template that gets the item instance as a parameter. In addition <i>header</i> slot is provided for further customization.</p>
|
|
|
|
</DocSectionText>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="card lg:flex lg:justify-center">
|
2024-04-02 09:21:07 +00:00
|
|
|
<OrderList v-model="products" dataKey="id" breakpoint="1400px" scrollHeight="20rem">
|
2024-04-02 08:38:38 +00:00
|
|
|
<template #item="{ item }">
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex flex-wrap p-1 items-center gap-4">
|
|
|
|
<img class="w-12 flex-shrink-0 rounded" :src="'https://primefaces.org/cdn/primevue/images/product/' + item.image" :alt="item.name" />
|
|
|
|
<div class="flex-1 flex flex-col gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-medium">{{ item.name }}</span>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex items-center gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<i class="pi pi-tag text-sm text-secondary"></i>
|
|
|
|
<span class="text-sm text-secondary">{{ item.category }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="font-bold">${{ item.price }}</span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</OrderList>
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" v-bind="$attrs" :service="['ProductService']" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ProductService } from '@/service/ProductService';
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
products: null,
|
|
|
|
code: {
|
|
|
|
basic: `
|
2024-04-02 09:21:07 +00:00
|
|
|
<OrderList v-model="products" dataKey="id" breakpoint="1400px" scrollHeight="20rem">
|
2024-04-02 08:38:38 +00:00
|
|
|
<template #item="{ item }">
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex flex-wrap p-1 items-center gap-4">
|
|
|
|
<img class="w-12 flex-shrink-0 rounded" :src="'https://primefaces.org/cdn/primevue/images/product/' + item.image" :alt="item.name" />
|
|
|
|
<div class="flex-1 flex flex-col gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-medium">{{ item.name }}</span>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex items-center gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<i class="pi pi-tag text-sm text-secondary"></i>
|
|
|
|
<span class="text-sm text-secondary">{{ item.category }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-bold">\${{ item.price }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</OrderList>
|
|
|
|
`,
|
|
|
|
options: `
|
|
|
|
<template>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="card lg:flex lg:justify-center">
|
2024-04-02 09:21:07 +00:00
|
|
|
<OrderList v-model="products" dataKey="id" breakpoint="1400px" scrollHeight="20rem">
|
2024-04-02 08:38:38 +00:00
|
|
|
<template #item="{ item }">
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex flex-wrap p-1 items-center gap-4">
|
|
|
|
<img class="w-12 flex-shrink-0 rounded" :src="'https://primefaces.org/cdn/primevue/images/product/' + item.image" :alt="item.name" />
|
|
|
|
<div class="flex-1 flex flex-col gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-medium">{{ item.name }}</span>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex items-center gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<i class="pi pi-tag text-sm text-secondary"></i>
|
|
|
|
<span class="text-sm text-secondary">{{ item.category }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-bold">\${{ item.price }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</OrderList>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ProductService } from '@/service/ProductService'
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
products: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
ProductService.getProductsSmall().then((data) => (this.products = data));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
<\/script>
|
|
|
|
`,
|
|
|
|
composition: `
|
|
|
|
<template>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="card lg:flex lg:justify-center">
|
2024-04-02 09:21:07 +00:00
|
|
|
<OrderList v-model="products" dataKey="id" breakpoint="1400px" scrollHeight="20rem">
|
2024-04-02 08:38:38 +00:00
|
|
|
<template #item="{ item }">
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex flex-wrap p-1 items-center gap-4">
|
|
|
|
<img class="w-12 flex-shrink-0 rounded" :src="'https://primefaces.org/cdn/primevue/images/product/' + item.image" :alt="item.name" />
|
|
|
|
<div class="flex-1 flex flex-col gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-medium">{{ item.name }}</span>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="flex items-center gap-1">
|
2024-04-02 09:21:07 +00:00
|
|
|
<i class="pi pi-tag text-sm text-secondary"></i>
|
|
|
|
<span class="text-sm text-secondary">{{ item.category }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-02 09:21:07 +00:00
|
|
|
<span class="font-bold">\${{ item.price }}</span>
|
2024-04-02 08:38:38 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</OrderList>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
import { ProductService } from '@/service/ProductService'
|
|
|
|
|
|
|
|
const products = ref(null);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
ProductService.getProductsSmall().then((data) => (products.value = data));
|
|
|
|
});
|
|
|
|
<\/script>
|
|
|
|
`,
|
|
|
|
data: `
|
|
|
|
/* ProductService */
|
|
|
|
{
|
|
|
|
id: '1000',
|
|
|
|
code: 'f230fh0g3',
|
|
|
|
name: 'Bamboo Watch',
|
|
|
|
description: 'Product Description',
|
|
|
|
image: 'bamboo-watch.jpg',
|
|
|
|
price: 65,
|
|
|
|
category: 'Accessories',
|
|
|
|
quantity: 24,
|
|
|
|
inventoryStatus: 'INSTOCK',
|
|
|
|
rating: 5
|
|
|
|
},
|
|
|
|
...`
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
ProductService.getProductsSmall().then((data) => (this.products = data));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|