File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
vuejs入门基础/my-second-vue-project/src Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 7
7
{{item.label}}
8
8
</li >
9
9
</ul >
10
+ <component-a msgfromfather =' you die!' ></component-a >
10
11
</div >
11
12
</template >
12
13
13
14
<script >
14
15
import Store from ' ./store'
16
+ import ComponentA from ' ./components/componentA'
15
17
export default {
16
18
data : function () {
17
19
return {
18
20
title: ' this is a todo list' ,
19
21
items: Store .fetch (),
20
- newItem: ' ' ,
21
- liClass: ' thisisliClass'
22
-
22
+ newItem: ' '
23
23
};
24
24
},
25
+ components: {ComponentA},
25
26
watch: {
26
27
items: {
27
28
handler : function (items ){
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" hello" >
3
3
<h1 >{{ msg }}</h1 >
4
+ <h1 >{{msgfromfather}}</h1 >
5
+ <button v-on:click =" onClickMe" >Click!</button >
4
6
</div >
5
7
</template >
6
8
7
9
<script >
8
10
export default {
9
11
data () {
10
12
return {
11
- msg: ' Hello Vue !'
13
+ msg: ' hello from component a !'
12
14
}
15
+ },
16
+ props: [' msgfromfather' ],
17
+ methods: {
18
+ onClickMe : function (){
19
+ console .log (this .msgfromfather );
20
+ }
13
21
}
14
22
}
15
23
</script >
20
28
color: #42b983;
21
29
}
22
30
</style>
31
+
32
+
You can’t perform that action at this time.
0 commit comments