我如何在 coffeescript 中使用 vue?
How do I use vue from coffeescript?
我有以下 coffeescript 代码:
app = new Vue el='#app',
data =
message: "Hello, World!"
已编译为以下javascript:
// Generated by CoffeeScript 2.3.2
var app, data, el;
app = new Vue(el = '#app', data = {
message: "Hello, World!"
});
//# sourceMappingURL=aesthetics.js.map
我有以下 HTML:
<!DOCTYPE html>
<html>
<head>
<title>Hello, world!</title>
</head>
<body>
<div id="app">
{{ message }}
</div>
<!-- Load JS -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="js/aesthetics.js"></script>
</body>
</html>
(Aesthetics.js 是我编译的 link,javascript,代码)。
当我 运行 我的应用程序似乎不起作用时。任何帮助表示赞赏。
new Vue
采用一个选项对象,而不是一系列参数。尝试(在 coffeescript 中)
new Vue(
app: '#app'
data: message: 'Hello world')
我有以下 coffeescript 代码:
app = new Vue el='#app',
data =
message: "Hello, World!"
已编译为以下javascript:
// Generated by CoffeeScript 2.3.2
var app, data, el;
app = new Vue(el = '#app', data = {
message: "Hello, World!"
});
//# sourceMappingURL=aesthetics.js.map
我有以下 HTML:
<!DOCTYPE html>
<html>
<head>
<title>Hello, world!</title>
</head>
<body>
<div id="app">
{{ message }}
</div>
<!-- Load JS -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="js/aesthetics.js"></script>
</body>
</html>
(Aesthetics.js 是我编译的 link,javascript,代码)。 当我 运行 我的应用程序似乎不起作用时。任何帮助表示赞赏。
new Vue
采用一个选项对象,而不是一系列参数。尝试(在 coffeescript 中)
new Vue(
app: '#app'
data: message: 'Hello world')