update
This commit is contained in:
parent
ed5401b64b
commit
20a227ca85
20
base/02.vue使用中{{}}取值时书写表达式.html
Normal file
20
base/02.vue使用中{{}}取值时书写表达式.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">{{username.toUpperCase()}} <br /></div>
|
||||
</body>
|
||||
<script src="./js/vue.js"></script>
|
||||
<script>
|
||||
const app = new Vue({
|
||||
//element 用来给Vue实例定义一个作用范围
|
||||
el: "#app",
|
||||
data: {
|
||||
username: "hello Vue",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</html>
|
@ -1,10 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$Title$</title>
|
||||
</head>
|
||||
<body>
|
||||
$END$
|
||||
</body>
|
||||
</html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
{{ msg }} <br />{{username}} <br />
|
||||
{{pwd}}
|
||||
<span v-for="item in items"> {{item.msg}} </span>
|
||||
<h3>{{url.url}}</h3>
|
||||
<h3>{{items[0].msg}}</h3>
|
||||
</div>
|
||||
</body>
|
||||
<script src="./js/vue.js"></script>
|
||||
<script>
|
||||
const app = new Vue({
|
||||
//element 用来给Vue实例定义一个作用范围
|
||||
el: "#app",
|
||||
data: {
|
||||
msg: "百知欢迎你,期待你的加入",
|
||||
username: "hello Vue",
|
||||
pwd: "12345",
|
||||
url: { url: "https://zyjblogs.cn" },
|
||||
items: [
|
||||
{ msg: "13131", age: 23 },
|
||||
{ msg: "14424", age: 23 },
|
||||
{ msg: "nini", age: 23 },
|
||||
],
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
@ -24,7 +24,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
// <!-- el , element缩写 ,挂载元素-->
|
||||
@ -44,7 +43,7 @@
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
axios.get("data.json").then((response) => (this.info = response.data));
|
||||
axios.get("data/data.json").then((response) => (this.info = response.data));
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
1736
base/js/axios.js
Normal file
1736
base/js/axios.js
Normal file
File diff suppressed because it is too large
Load Diff
11965
base/js/vue.js
Normal file
11965
base/js/vue.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$Title$</title>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<!-- 开发环境版本,包含了有帮助的命令行警告 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
$END$
|
||||
<div id="app">
|
||||
{{a}}{{b}}
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
var data = {a : 1,b : 2};
|
||||
var vm = new Vue({
|
||||
el : "#app",
|
||||
data : data
|
||||
});
|
||||
data.a = "hi ..... new ....";
|
||||
data.b = "test"
|
||||
vm.$data.b = "test1"
|
||||
vm.$watch('a',function (newVal,oldVal){
|
||||
console.log(newVal,oldVal);
|
||||
})
|
||||
vm.$data.a = "test1"
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user