mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
fix recipe static routes
This commit is contained in:
parent
625dbcdea5
commit
8710dad727
11 changed files with 54 additions and 29 deletions
|
@ -18,6 +18,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { useStaticRoutes } from "~/composables/api";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
export default {
|
||||
props: {
|
||||
|
@ -53,7 +54,9 @@ export default {
|
|||
setup() {
|
||||
const api = useApiSingleton();
|
||||
|
||||
return { api };
|
||||
const { recipeImage, recipeSmallImage, recipeTinyImage } = useStaticRoutes();
|
||||
|
||||
return { api, recipeImage, recipeSmallImage, recipeTinyImage };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -77,11 +80,11 @@ export default {
|
|||
getImage(slug) {
|
||||
switch (this.imageSize) {
|
||||
case "tiny":
|
||||
return this.api.recipes.recipeTinyImage(slug, this.imageVersion);
|
||||
return this.recipeTinyImage(slug, this.imageVersion);
|
||||
case "small":
|
||||
return this.api.recipes.recipeSmallImage(slug, this.imageVersion);
|
||||
return this.recipeSmallImage(slug, this.imageVersion);
|
||||
case "large":
|
||||
return this.api.recipes.recipeImage(slug, this.imageVersion);
|
||||
return this.recipeImage(slug, this.imageVersion);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue