组件之props
lufangzhou 8/25/2020 vue
# 基本用法
props: ['params1', 'params2']
1
# 详细用法
"refAge": {
type: Number,
default: 0
},
"refName": {
type: String,
default: ''
},
"hotDataLoading": {
type: Boolean,
default: false
},
"hotData": {
type: Array,
default: () => {
return []
}
},
"getParams": {
type: Function,
default: () => () => {}
},
"meta": {
type: Object,
default: () => ({})
}
"props": {
title: String,
likes: Number,
isPublished: Boolean,
commentIds: Array,
author: Object,
callback: Function,
contactsPromise: Promise // or any other constructor
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35