Skip to content

Instantly share code, notes, and snippets.

@sakishum
Created January 17, 2019 02:32
Show Gist options
  • Save sakishum/93c0826d04441aaedb2a167779b60583 to your computer and use it in GitHub Desktop.
Save sakishum/93c0826d04441aaedb2a167779b60583 to your computer and use it in GitHub Desktop.
first vue demo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<!--这是我们的View-->
<div id="app">
<p>{{ message }}</p>
<input type="text" v-model="message"/>
</div>
</body>
<script>
// 这是我们的Model
var exampleData = {
message: 'Hello World!'
}
// 创建一个 Vue 实例或 "ViewModel"
// 它连接 View 与 Model
new Vue({
el: '#app',
data: exampleData
})
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment