File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -380,7 +380,6 @@ function getInternalInstanceChildren (instance) {
380
380
if ( instance . $children ) {
381
381
return instance . $children
382
382
}
383
- console . log ( instance . subTree . children )
384
383
if ( Array . isArray ( instance . subTree . children ) ) {
385
384
return instance . subTree . children . filter ( vnode => ! ! vnode . component ) . map ( vnode => vnode . component )
386
385
}
@@ -769,13 +768,18 @@ function processState (instance) {
769
768
const getters =
770
769
type . vuex &&
771
770
type . vuex . getters
771
+ const computedDefs = type . computed
772
772
773
- const data = instance . _data || instance . renderContext || { }
773
+ const data = instance . _data || {
774
+ ...instance . data ,
775
+ ...instance . renderContext
776
+ } || { }
774
777
775
778
return Object . keys ( data )
776
779
. filter ( key => (
777
780
! ( props && key in props ) &&
778
- ! ( getters && key in getters )
781
+ ! ( getters && key in getters ) &&
782
+ ! ( computedDefs && key in computedDefs )
779
783
) )
780
784
. map ( key => ( {
781
785
key,
@@ -825,7 +829,7 @@ function processComputed (instance) {
825
829
computedProp = {
826
830
type,
827
831
key,
828
- value : instance [ key ]
832
+ value : instance . renderContext ? instance . renderContext [ key ] : instance [ key ]
829
833
}
830
834
} catch ( e ) {
831
835
computedProp = {
Original file line number Diff line number Diff line change 1
1
<script >
2
- import { ref } from ' vue'
2
+ import { ref , computed } from ' vue'
3
3
4
4
export default {
5
5
name: ' Child' ,
6
6
7
7
setup () {
8
8
const answer = ref (42 )
9
9
10
+ const doubleAnswer = computed (() => answer .value * 2 )
11
+
12
+ return {
13
+ answer,
14
+ doubleAnswer
15
+ }
16
+ },
17
+
18
+ data () {
10
19
return {
11
- answer
20
+ classicAnswer: 42
21
+ }
22
+ },
23
+
24
+ computed: {
25
+ classicDoubleAnswer () {
26
+ return this .classicAnswer * 2
12
27
}
13
28
}
14
29
}
15
30
</script >
16
31
17
32
<template >
18
33
<div >
19
- Child: {{ answer }}
34
+ Child: {{ answer }} x2: {{ doubleAnswer }}
20
35
</div >
21
36
</template >
You can’t perform that action at this time.
0 commit comments