直接看代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue實驗</title>
</head>
<script src="js/vue.js"></script>
<body>
<div id="app">
{{message}}
</div>
</body>
<script>
//創建Vue對象 view model
new Vue({
el: "#app",//由vue接管id爲app的區域
data: {
message:"Hello Vue!!! This Is Test"//注意此處不要加分號
}
});
</script>
</html>
運行結果: