Is it possible to use the same app multiple times on the same page with VueJS?

Viewed 1334

I have an project where I retrieve data from my backend and show it on the frontend using vue.js, I need to use the same app multiple times OR use an app in an app.

Here's an example, https://jsfiddle.net/Lsc7hggs/4/ :

<!-- app in app -->
<div class="colorHandler">
    <div class="nameHandler">
         <p>[% nameAttr() %]</p>
         <p>[% nameAttr() %]</p>
         <p>[% randomColor() %]</p>
         <p>[% randomColor() %]</p>
    </div>
</div>

<hr> <!-- OR -->

<!-- multiple time the same app -->
<div class="nameHandler">
  <p>[% nameAttr() %]</p>
</div>

<div class="nameHandler">
  <p>[% nameAttr() %]</p>
</div>

<div class="colorHandler">
<p>[% randomColor() %]</p>
</div>

<div class="colorHandler">
<p>[% randomColor() %]</p>
</div>

Is there a way to make this work ?

2 Answers
Related