Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[jsfm] attach data to WeexInstance (#1909)
Browse files Browse the repository at this point in the history
* [jsfm] attach data to WeexInstance
* [jsfm] change weex.data to weex._nativeData
  • Loading branch information
imyzf authored and Hanks10100 committed Dec 14, 2018
1 parent 3a7f33a commit 183a9c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion runtime/api/WeexInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ function moduleSetter (id, module, method, fn) {
}

export default class WeexInstance {
constructor (id, config) {
constructor (id, config, data) {
setId(this, String(id))
this.config = config || {}
this._nativeData = data || {}
this.document = new Document(id, this.config.bundleUrl)
this.requireModule = this.requireModule.bind(this)
this.importScript = this.importScript.bind(this)
Expand Down
2 changes: 1 addition & 1 deletion runtime/api/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getFrameworkType (id) {
}

function createInstanceContext (id, options = {}, data) {
const weex = new WeexInstance(id, options)
const weex = new WeexInstance(id, options, data)

const bundleType = options.bundleType || 'Vue'
instanceTypeMap[id] = bundleType
Expand Down

0 comments on commit 183a9c3

Please sign in to comment.