使用App.Page,页面直接空白
atom-7 opened this issue · 3 comments
atom-7 commented
我在index页面使用是App.Page() 创建页面,页面加载不了直接空白了,怎么解决
xiaoyao96 commented
需要在app.js 第一行引入并初始化后才能使用:
import Store from 'wxministore'
const store = new Store({
...
})
App({...});
xiaoyao96 commented
或者创建一个目录store/index.js
// store/index.js
import Store from 'wxministore'
export default new Store({
...
});
// --------------------------------------
// 以下为app.js
import store from './store/index.js'
App({
store,
...
})
xiaoyao96 commented
以上两种方式引入后,才能在其他页面或组件里,使用App.Page 和 App.Component