Skip to content

Commit 0da8bce

Browse files
Hanks10100yyx990803
authored andcommitted
fix(weex): send createFinish signal after root component mounted (#7154)
1 parent 7166c4e commit 0da8bce

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: src/platforms/weex/entry-framework.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,8 @@ export function createInstance (
6161
}, timerAPIs, env.services)
6262

6363
appCode = `(function(global){ \n${appCode}\n })(Object.create(this))`
64-
6564
callFunction(instanceVars, appCode)
6665

67-
// Send `createFinish` signal to native.
68-
document.taskCenter.send('dom', { action: 'createFinish' }, [])
69-
7066
return instance
7167
}
7268

@@ -208,6 +204,16 @@ function createVueModuleInstance (instanceId, weex) {
208204
// record instance by id
209205
instance.app = this
210206
}
207+
},
208+
mounted () {
209+
const options = this.$options
210+
// root component (vm)
211+
if (options.el && weex.document) {
212+
try {
213+
// Send "createFinish" signal to native.
214+
weex.document.taskCenter.send('dom', { action: 'createFinish' }, [])
215+
} catch (e) {}
216+
}
211217
}
212218
})
213219

0 commit comments

Comments
 (0)