File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -139,16 +139,26 @@ export default {
139
139
}
140
140
},
141
141
computed: {
142
- componentOptions () {
143
- const component = Vue .options .components [this .component ]
144
- return component && component .options ? component .options : {}
145
- },
146
- propsFields () {
142
+ componentProps () {
147
143
const component = Vue .options .components [this .component ]
144
+ if (! component) {
145
+ return {}
146
+ }
147
+
148
148
let props = {}
149
- if (component) {
149
+ if (! component .options && typeof component === ' function' ) {
150
+ // Async component that hans't been resolved yet.
151
+ component (opts => {
152
+ props = opts .props ? { ... opts .props } : {}
153
+ })
154
+ } else {
155
+ // Regular component
150
156
props = component .options .props || {}
151
157
}
158
+ },
159
+ propsFields () {
160
+ const component = Vue .options .components [this .component ]
161
+ const props = this .componentProps
152
162
153
163
const hasRequired = Object .keys (props).some (p => props[p].required )
154
164
@@ -186,19 +196,10 @@ export default {
186
196
propsItems () {
187
197
const component = Vue .options .components [this .component ]
188
198
if (! component) {
189
- return {}
199
+ return []
190
200
}
191
201
192
- let props = {}
193
- if (! component .options && typeof component === ' function' ) {
194
- // Async component that hans't been resolved yet.
195
- component (opts => {
196
- props = opts .props ? { ... opts .props } : {}
197
- })
198
- } else {
199
- // Regular component
200
- props = component .options .props || {}
201
- }
202
+ const props = this .componentProps : {}
202
203
203
204
return Object .keys (props).map (prop => {
204
205
const p = props[prop]
You can’t perform that action at this time.
0 commit comments