关于 Vue 的问题。。。
请问各位大神,Vue到底是怎么用的 在用之前需要安装什么吗?我写了代码 报Vue找不到怎么回事?<!DOCTYPE html>
<html xmlns="http://www.
xmlns:th="http://www.
xmlns:sec="http://www.
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no" charset="utf-8" />
<title>home</title>
<link th:href="@{/resources/bootstrap/3.3.7/css/bootstrap.css}" type="text/css" rel="stylesheet" />
<script th:src="@{/resources/vue/2.1.3/vue.js}" type="text/javascript"></script>
<script th:src="@{/resources/vue/2.1.3/vue.js}" type="text/javascript"></script>
</head>
<body>
<div id="app">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
<script type="text/javascript">
var Main = {
data() {
return {
data: [{
label: '一级 1',
children: [{
label: '二级 1-1'
}]
}, {
label: '一级 2',
children: [{
label: '二级 2-1',
}, {
label: '二级 2-2'
}]
}, {
label: '一级 3',
children: [{
label: '二级 3-1',
}, {
label: '二级 3-2'
}]
}],
defaultProps: {
children: 'children',
label: 'label'
}
};
},
methods: {
handleNodeClick(data) {
console.log(data);
}
}
};
var vm = new Vue();
var Ctor = vm.extend(Main)
new Ctor().$mount('#app')
</script>
</body>
</html>