File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
packages/uni-mp-core/src/runtime Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 66 ref ,
77} from 'vue'
88
9- import { initBaseInstance } from './componentInstance'
9+ import { callHook , hasHook , initBaseInstance } from './componentInstance'
1010import { initHooks , initUnknownHooks } from './componentHooks'
1111import { getLocaleLanguage } from '../runtime/util'
1212
@@ -123,8 +123,8 @@ export function initCreateSubpackageApp(parseAppOptions?: ParseAppOptions) {
123123 } )
124124 if ( ! app ) return
125125 ; ( vm . $ as any ) . ctx . $scope = app
126- ( vm . $ as any ) . ctx . $hasHook = hasHook
127- ( vm . $ as any ) . ctx . $callHook = callHook
126+ ; ( vm . $ as any ) . ctx . $hasHook = hasHook
127+ ; ( vm . $ as any ) . ctx . $callHook = callHook
128128 const globalData = app . globalData
129129 if ( globalData ) {
130130 Object . keys ( appOptions . globalData ) . forEach ( ( name ) => {
Original file line number Diff line number Diff line change @@ -187,15 +187,19 @@ export function initMocks(
187187 } )
188188}
189189
190- function hasHook ( this : ComponentPublicInstance , name : string ) {
190+ export function hasHook ( this : ComponentPublicInstance , name : string ) {
191191 const hooks = ( this . $ as any ) [ name ]
192192 if ( hooks && hooks . length ) {
193193 return true
194194 }
195195 return false
196196}
197197
198- function callHook ( this : ComponentPublicInstance , name : string , args ?: unknown ) {
198+ export function callHook (
199+ this : ComponentPublicInstance ,
200+ name : string ,
201+ args ?: unknown
202+ ) {
199203 if ( name === 'mounted' ) {
200204 callHook . call ( this , 'bm' ) // beforeMount
201205 this . $ . isMounted = true
You can’t perform that action at this time.
0 commit comments