fix data error

This commit is contained in:
dntzhang 2018-11-08 09:41:26 +08:00
parent db5da69e77
commit 9096a3e6d2
2 changed files with 16 additions and 18 deletions

View File

@ -42,10 +42,10 @@ function render() {
//获取应用实例
const app = getApp()
Page({
const mpOption = Page({
data: {
motto: 'Hello World',
userInfo: {},
motto: 'Hello omi-mp',
userInfo: { nickName: 'dntzhang' },
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
@ -94,15 +94,7 @@ Page({
})
class Element extends WeElement {
install() {
this.data = {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
}
console.log(111)
}
data = mpOption.data
render = render
@ -110,13 +102,13 @@ class Element extends WeElement {
this._useId = 0
}
beforeUpdate() {}
beforeUpdate() { }
afterUpdate() {}
afterUpdate() { }
uninstall() {}
uninstall() { }
installed() {}
installed() { }
}
customElements.define('my-app', Element)

View File

@ -1,10 +1,16 @@
import omi from 'omi'
function App() {}
function getApp() {}
function Page() {}
function Page(option) {
return option
}
function Component() {}
function Component(option) {
return option
}
function noop() {}
const wx = {}