Skip to content

Commit 2d24010

Browse files
committed
test
1 parent e771034 commit 2d24010

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+44254
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.inner{
9+
height:150px;
10+
background-color: darkcyan;
11+
}
12+
13+
14+
</style>
15+
</head>
16+
<body>
17+
<div id="root">
18+
<div class="inner" @click.capture="divHandel">
19+
<input type="button" value="点击" @click.capture="btnHandel">
20+
</div>
21+
22+
</div>
23+
<script src="../vue-2.4.0.js"></script>
24+
<script>
25+
var vm = new Vue({
26+
el:"#root",
27+
data:{},
28+
methods:{
29+
divHandel(){
30+
console.log('这里是触发了 innerdiv的事件');
31+
32+
},
33+
btnHandel(){
34+
console.log('这里是触发了btn事件');
35+
36+
}
37+
}
38+
})
39+
40+
41+
</script>
42+
</body>
43+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.inner{
9+
height:150px;
10+
background-color: darkcyan;
11+
}
12+
13+
14+
</style>
15+
</head>
16+
<body>
17+
<div id="root">
18+
<p>{{msg | msgFormat('疯狂','清纯') | test}}</p>
19+
<h2>{{dt | dateFormat('yyyy-mm-dd')}}</h2>
20+
</div>
21+
<script src="../vue-2.4.0.js"></script>
22+
<script>
23+
// 全局过滤器是每一个组件都可以使用的
24+
Vue.filter('msgFormat',function(msg,arg,arg2){
25+
return msg.replace(//g,arg+arg2)
26+
})
27+
Vue.filter('test',function(msg){
28+
return msg+'========='
29+
})
30+
var vm = new Vue({
31+
el:"#root",
32+
data:{
33+
msg:"曾经,我也是一个单纯的少年,单纯的我,傻傻的问,谁是世界上最单纯的男人",
34+
dt:new Date()
35+
},
36+
methods:{
37+
38+
},
39+
filters:{
40+
dateFormat:function(dateStr,partten=''){
41+
var dt = new Date()
42+
var y = dt.getFullYear()
43+
var m = (dt.getMonth() + 1).toString().padStart(2,'0')
44+
var d = (dt.getDate()).toString().padStart(2,'0')
45+
46+
if(partten.toLowerCase() === 'yyyy-mm-dd'){
47+
return `${y}-${m}-${d}`
48+
}else{
49+
var hh = dt.getHours().toString().padStart(2,'0')
50+
var mm = dt.getMinutes().toString().padStart(2,'0')
51+
var ss = dt.getSeconds().toString().padStart(2,'0')
52+
return `${y}-${m}-${d} ${hh}:${mm}:${ss}=====`
53+
}
54+
}
55+
}
56+
})
57+
58+
59+
</script>
60+
</body>
61+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.inner{
9+
height:150px;
10+
background-color: darkcyan;
11+
}
12+
13+
14+
</style>
15+
</head>
16+
<body>
17+
<div id="root">
18+
<a href="http://www.baidu.com" @click.prevent.once="linkClick">有问题去百度</a>
19+
</div>
20+
<script src="../vue-2.4.0.js"></script>
21+
<script>
22+
var vm = new Vue({
23+
el:"#root",
24+
data:{},
25+
methods:{
26+
linkClick(){
27+
console.log('这里是触发了a链接的事件');
28+
29+
},
30+
}
31+
})
32+
33+
34+
</script>
35+
</body>
36+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.inner{
9+
height:150px;
10+
background-color: darkcyan;
11+
}
12+
13+
14+
</style>
15+
</head>
16+
<body>
17+
<div id="root">
18+
<a href="http://www.baidu.com" @click.prevent="linkClick">有问题去百度</a>
19+
</div>
20+
<script src="../vue-2.4.0.js"></script>
21+
<script>
22+
var vm = new Vue({
23+
el:"#root",
24+
data:{},
25+
methods:{
26+
linkClick(){
27+
console.log('这里是触发了a链接的事件');
28+
29+
},
30+
}
31+
})
32+
33+
34+
</script>
35+
</body>
36+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.inner{
9+
height:150px;
10+
background-color: darkcyan;
11+
}
12+
13+
14+
</style>
15+
</head>
16+
<body>
17+
<div id="root">
18+
<div class="inner" @click.self="divHandel">
19+
<input type="button" value="点击" @click="btnHandel">
20+
</div>
21+
22+
</div>
23+
<script src="../vue-2.4.0.js"></script>
24+
<script>
25+
var vm = new Vue({
26+
el:"#root",
27+
data:{},
28+
methods:{
29+
divHandel(){
30+
console.log('这里是触发了 innerdiv的事件');
31+
32+
},
33+
btnHandel(){
34+
console.log('这里是触发了btn事件');
35+
36+
}
37+
}
38+
})
39+
40+
41+
</script>
42+
</body>
43+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.inner{
9+
height:150px;
10+
background-color: darkcyan;
11+
}
12+
13+
14+
</style>
15+
</head>
16+
<body>
17+
<div id="root">
18+
<div class="inner" @click="divHandel">
19+
<input type="button" value="点击" @click.stop="btnHandel">
20+
</div>
21+
22+
</div>
23+
<script src="../vue-2.4.0.js"></script>
24+
<script>
25+
var vm = new Vue({
26+
el:"#root",
27+
data:{},
28+
methods:{
29+
divHandel(){
30+
console.log('这里是触发了 innerdiv的事件');
31+
32+
},
33+
btnHandel(){
34+
console.log('这里是触发了btn事件');
35+
36+
}
37+
}
38+
})
39+
40+
41+
</script>
42+
</body>
43+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>stop</title>
7+
<style>
8+
.outer{
9+
padding:40px;
10+
background-color: red;
11+
}
12+
.inner{
13+
height:150px;
14+
background-color: darkcyan;
15+
}
16+
17+
18+
</style>
19+
</head>
20+
<body>
21+
<div id="root">
22+
<div class="outer" @click="outerHandel">
23+
<div class="inner" @click.self="divHandel">
24+
<input type="button" value="点击" @click="btnHandel">
25+
</div>
26+
27+
</div>
28+
29+
</div>
30+
<script src="../vue-2.4.0.js"></script>
31+
<script>
32+
var vm = new Vue({
33+
el:"#root",
34+
data:{},
35+
methods:{
36+
divHandel(){
37+
console.log('这里是触发了 innerdiv的事件');
38+
39+
},
40+
btnHandel(){
41+
console.log('这里是触发了btn事件');
42+
43+
},
44+
outerHandel(){
45+
console.log('这里是触发了 outerdiv的事件');
46+
47+
}
48+
}
49+
})
50+
51+
52+
</script>
53+
</body>
54+
</html>

0 commit comments

Comments
 (0)