【发布时间】:2018-11-29 03:24:51
【问题描述】:
下面是我的 index.html 文件
<!doctype html>
<html><head>
<body>
<h1>ES</h1>
<div id="app">
{{ message }}
</div>
<script src="dist/main.js" type="text/javascript"></script></head>
</body>
</html>
我正在尝试使用基本的 vue.js 声明式渲染。我的零配置 webpack 的 index.js 输入如下
import Vue from 'vue';
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
message 的值没有显示在页面中。这与我的 webpack 配置有关吗?我需要使用 Babel 转译器来让它工作吗?
【问题讨论】:
-
您的
<head>和<body>标签嵌套不正确。