Duplicated HTML
Closed this issue · 1 comments
Hi, this is more of a question.
I am building custom element within my plugin. I will be using same html output for administration and storefront.
But I kinda noticed in platform repo that html in component can be used with Vue.js only and html in storefront view can be used with Twig only.
This way I need to repeat my html code twice, once with Vue.js, secondly with Twig (different usage of outputting variables). Or am I doing something wrong?
Thank you so much for the answers.
I will answer this to myself.
It is a proper way since admin is built with Vue.js and you want to have live changes when changing component's config - so, your component should contain Vue.js code + HTML.
On the other hand, storefront is more or less static and it is server-side rendered, this is why you use Twig + HTML there.