来自Vue documentation:
处理模板有点不同,因为大多数网页
TestComponent.vue:
<template lang="pug">
div
h2 {{ message }}
</template>
<script>
export default {
data () {
return {
message: 'Done!!! Done...'
}
}
}
</script>
main.js:
import Vue from 'vue'
import TestComponent from './../components/TestComponent/TestComponent.vue'
new Vue({
el: '#app',
render: h => h(TestComponent)
});
错误:
NonErrorEmitted错误: (Emitted value instead of an instance of Error)
Error compiling template:
div
h2 {{ message }}
- Component template requires a root element, rather than just text.
使用的依赖项版本:
- "网页包":"^4.7.0"
- "vue":"^2.5.16"
- "vue加载程序":"^15.2.4",
- "vue模板编译器":"^2.5.16",
- "帕格":"^2.0.3"