This is my code:
window.onload = function () {
var main = new Vue({
el: '#main',
data: {
currentActivity: 'home'
}
});
Vue.component('home', {
template: '#home-template'
});
};
This is my template:
<head>
<script type="text/x-template" id="home-template">
<div class="banner dark">
<div class="content">says some shit</div>
</div>
<div class="banner light">
<div class="content">says some other shit</div>
</div>
</script>
</head>
When I load the page I get this warning:
[Vue warn]: Failed to resolve component: home
and this error:
Uncaught TypeError: Cannot read property '_refID' of undefined
What am I doing wrong?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.