diff --git a/src/components/CompactParsedIngredient.vue b/src/components/CompactParsedIngredient.vue index a1671d0..78f7c5b 100644 --- a/src/components/CompactParsedIngredient.vue +++ b/src/components/CompactParsedIngredient.vue @@ -11,7 +11,12 @@ ( {{ ingredient?.product?.name }} ) - ( {{ 'product' }} ) + + (search?) + + + (product) + @@ -21,6 +26,11 @@ export default { name: 'CompactParsedIngredient', props: ['ingredient'], + computed: { + searchlink() { + return 'https://www.woolworths.com.au/shop/search/products?searchTerm=' + encodeURIComponent(this.ingredient.name); + } + } } @@ -38,7 +48,6 @@ export default { margin: auto 0; margin-right: 1em; border-bottom: solid 1px #ccc; - padding-left: 0.5em; } .parse-element.missing { diff --git a/src/components/IngredientAddBox.vue b/src/components/IngredientAddBox.vue index 945ee64..74a29f6 100644 --- a/src/components/IngredientAddBox.vue +++ b/src/components/IngredientAddBox.vue @@ -3,8 +3,7 @@

+ @update-product-link="updateProduct" />

diff --git a/src/components/IngredientLine.vue b/src/components/IngredientLine.vue index a8e9098..075f9fa 100644 --- a/src/components/IngredientLine.vue +++ b/src/components/IngredientLine.vue @@ -22,13 +22,14 @@ export default { components: { CompactParsedIngredient }, data() { return { - ingredientText: this.ingredient.line, + ingredientText: this.ingredient?.line ?? "", productLink: this.ingredient.product?.link ?? "", }; }, watch: { ingredient: { handler: function (newIngredient) { + this.ingredientText = newIngredient?.line ?? ""; this.productLink = newIngredient.product?.link ?? ""; }, deep: true,