内容纲要

绑定两个字段到模板中

[code language=”html”]
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue.js</title>
</head>

<body>
<div id="app"></div>

<script src="http://unpkg.com/vue"></script>

<script>
new Vue({
el: ‘#app’,
data: {
name: ‘Vue.js Devtools’,
browser: ‘Google Chrome’
},
template: `
<div>
<p> I’m using {{name}} with {{browser}}</p>
</div>
`
});
</script>
</body>

</html>
[/code]

发表评论

电子邮件地址不会被公开。 必填项已用*标注