这是我的代码:
window.onload = function () {
var main = new Vue({
el: '#main',
data: {
currentActivity: 'home'
}
});
Vue.component('home', {
template: '#home-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>
当我加载页面时,我收到此警告:
[Vue warn]: Failed to resolve component: home
并出现此错误:
Uncaught TypeError: Cannot read property '_refID' of undefined
我做错了什么?