2π
β
-
The below
html
which has anid
of#test-app
derives itsvue-instance
properties from thenew Vue(...)
part of the code. Which really doesnβt havetitle
and hence the error.<div class="echelon-main-container" id="test-app"> <test-empower></test-empower> <script type="x-template" id="test-empower"> <section class="test-empower" id="test-empower"> <h2 class="header-title">{{ title }}</h2> <h2 class="header-subtitle">{{ description }}</h2> </section> </script> </div>
-
The
el
property in thenew Vue(...)
specifies themount
point for thenew Vue()
instance you are creating. -
In the
Vue.component(...)
:Vue.component('test-empower', { template: '#test-empower' });
#test-empower
is not the mount point as you are expecting. It is the template this component must use when<test-empower>
is used in your application.
As per the edit, you need to separate out your templates to resolve your need of having separate properties like in this fiddle.
π€Amresh Venugopal
Source:stackexchange.com