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 11import { defineComponent } from 'vue' ;
22import A from './A' ;
33import { B } from './B' ;
4-
4+ import C from './C'
55const App = defineComponent ( {
66 data ( ) {
77 return {
@@ -16,6 +16,7 @@ const App = defineComponent({
1616 < div onClick = { ( ) => { this . a ++ ; } } > Hello World!</ div >
1717 < A />
1818 < B />
19+ < C />
1920 </ >
2021 )
2122 }
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(
6767 if ( t . isIdentifier ( declaration ) ) {
6868 if ( declaredComponents . find ( d => d . name === declaration . name ) ) {
6969 hotComponents . push ( {
70- local : '__default__' ,
70+ local : declaration . name ,
7171 id : hash ( `${ filename } -default` )
7272 } )
7373 }
@@ -76,6 +76,7 @@ export default function loader(
7676 local : '__default__' ,
7777 id : hash ( `${ filename } -default` )
7878 } ) ;
79+ hasDefault = true
7980 }
8081 }
8182 }
You can’t perform that action at this time.
0 commit comments