使用Vue (^2.0.0-rc.6)+Browserify,入口点是索引.js:
import Vue from 'vue'
import App from './containers/App.vue'
new Vue({ // eslint-disable-line no-new
el: '#root',
render: (h) => h(App)
})
应用程序.vue:
<template>
<div id="root">
<hello></hello>
</div>
</template>
<script>
import Hello from '../components/Hello.vue'
export default {
components: {
Hello
}
}
</script>
<style>
body {
font-family: Helvetica, sans-serif;
}
</style>
你好.vue:
<template>
<div class="hello">
<h1>\{{ msg }}</h1>
</div>
</template>
<script>
export default {
data () {
return {
msg: 'Hello Vue!'
}
}
}
</script>
空白的白色屏幕,我错过了什么吗?
编辑:
输入的html只有<div id="root"></div>
,控制台日志(log)上没有错误,我很确定您好.vue是从该文件出现在控制台上开始加载的.
编辑2:
发现错误:
[Vue warn]:您正在使用仅运行时版本的Vue,其中
这是否意味着我必须使用webpack解决方案?不能使用标准HTML?
SOLUTION: