File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { defineComponent } from 'vue' ;
2
2
import A from './A' ;
3
3
import { B } from './B' ;
4
-
4
+ import C from './C'
5
5
const App = defineComponent ( {
6
6
data ( ) {
7
7
return {
@@ -16,6 +16,7 @@ const App = defineComponent({
16
16
< div onClick = { ( ) => { this . a ++ ; } } > Hello World!</ div >
17
17
< A />
18
18
< B />
19
+ < C />
19
20
</ >
20
21
)
21
22
}
Original file line number Diff line number Diff line change
1
+ import { defineComponent , onMounted , ref } from 'vue' ;
2
+
3
+ export default defineComponent ( {
4
+ setup ( ) {
5
+ onMounted ( ( ) => {
6
+ console . log ( 'C' )
7
+ } )
8
+ const c = ref ( 0 )
9
+ return ( ) => ( < >
10
+ < div onClick = { ( ) => {
11
+ c . value ++
12
+ } } > 点我加一个
13
+ </ div >
14
+ < span > 我是点C 我的值是 { c . value } </ span >
15
+ </ > )
16
+ }
17
+ } ) ;
18
+
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default function loader(
67
67
if ( t . isIdentifier ( declaration ) ) {
68
68
if ( declaredComponents . find ( d => d . name === declaration . name ) ) {
69
69
hotComponents . push ( {
70
- local : '__default__' ,
70
+ local : declaration . name ,
71
71
id : hash ( `${ filename } -default` )
72
72
} )
73
73
}
@@ -76,6 +76,7 @@ export default function loader(
76
76
local : '__default__' ,
77
77
id : hash ( `${ filename } -default` )
78
78
} ) ;
79
+ hasDefault = true
79
80
}
80
81
}
81
82
}
You can’t perform that action at this time.
0 commit comments