generated from posva/vite-tailwind-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(product): if brand missing, show warning color & tooltip (#422)
- Loading branch information
Showing
5 changed files
with
49 additions
and
35 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,36 @@ | ||
<template> | ||
<span v-if="productBrands && productBrands.length"> | ||
<v-chip v-for="brand in getProductBrandsList" :key="brand" label size="small" density="comfortable" class="mr-1" @click="goToBrand(brand)"> | ||
{{ brand }} | ||
</v-chip> | ||
</span> | ||
<v-chip v-if="!productBrands" label size="small" density="comfortable" prepend-icon="mdi-help" color="warning" class="mr-1"> | ||
{{ $t('ProductCard.BrandLower') }} | ||
<v-tooltip activator="parent" open-on-click location="top">{{ $t('ProductCard.ProductBrandMissing') }}</v-tooltip> | ||
</v-chip> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
productBrands: String, | ||
readonly: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
computed: { | ||
getProductBrandsList() { | ||
return this.productBrands.split(',') | ||
} | ||
}, | ||
methods: { | ||
goToBrand(brand) { | ||
if (this.readonly) { | ||
return | ||
} | ||
this.$router.push({ path: `/brands/${brand}` }) | ||
}, | ||
} | ||
} | ||
</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
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