generated from posva/vite-tailwind-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(product): new ProductCategoriesChip & ProductLabelsChip (#416)
- Loading branch information
Showing
3 changed files
with
78 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<v-chip label size="small" density="comfortable" class="mr-1" @click="showProductCategoriesDialog"> | ||
{{ $t('ProductCard.CategoryTotal', { count: productCategories ? productCategories.length : 0 }) }} | ||
</v-chip> | ||
|
||
<ProductCategoriesDialog | ||
v-if="productCategories && productCategoriesDialog" | ||
:categories="productCategories" | ||
v-model="productCategoriesDialog" | ||
@close="productCategoriesDialog = false" | ||
></ProductCategoriesDialog> | ||
</template> | ||
|
||
<script> | ||
import { defineAsyncComponent } from 'vue' | ||
export default { | ||
components: { | ||
'ProductCategoriesDialog': defineAsyncComponent(() => import('../components/ProductCategoriesDialog.vue')), | ||
}, | ||
props: { | ||
productCategories: null, | ||
}, | ||
data() { | ||
return { | ||
productCategoriesDialog: false | ||
} | ||
}, | ||
computed: { | ||
}, | ||
methods: { | ||
showProductCategoriesDialog() { | ||
this.productCategoriesDialog = true | ||
}, | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<v-chip label size="small" density="comfortable" class="mr-1" @click="showProductLabelsDialog"> | ||
{{ $t('ProductCard.LabelTotal', { count: productLabels ? productLabels.length : 0 }) }} | ||
</v-chip> | ||
|
||
<ProductLabelsDialog | ||
v-if="productLabels && productLabelsDialog" | ||
:labels="productLabels" | ||
v-model="productLabelsDialog" | ||
@close="productLabelsDialog = false" | ||
></ProductLabelsDialog> | ||
</template> | ||
|
||
<script> | ||
import { defineAsyncComponent } from 'vue' | ||
export default { | ||
components: { | ||
'ProductLabelsDialog': defineAsyncComponent(() => import('../components/ProductLabelsDialog.vue')), | ||
}, | ||
props: { | ||
productLabels: null, | ||
}, | ||
data() { | ||
return { | ||
productLabelsDialog: false | ||
} | ||
}, | ||
computed: { | ||
}, | ||
methods: { | ||
showProductLabelsDialog() { | ||
this.productLabelsDialog = true | ||
}, | ||
} | ||
} | ||
</script> |