import App from './App'
|
|
// #ifndef VUE3
|
import Vue from 'vue'
|
Vue.config.productionTip = false
|
import store from './store'
|
Vue.prototype.$store = store
|
uni.$store=store
|
import socket from '@/common/socket.js'
|
Vue.prototype.$socket = socket;
|
//uView-ui
|
import uView from '@/uni_modules/uview-ui'
|
Vue.use(uView)
|
|
import { usqlite } from '@/uni_modules/onemue-USQLite/js_sdk/usqlite.js' // 挂载 v2 版本
|
// import sql from "@/model/index.js"
|
usqlite.connect({
|
name: 'demo',// 数据库名称
|
path:'_doc/demo.db', // 路径
|
});
|
|
// uni.sql = sql; // 绑定所有model 到uni.sql 或者其他都可以 只有usqlite v2才支持这种写法
|
uni.$sql = usqlite;
|
|
Vue.prototype.$dbOptions = {
|
name: 'demo',
|
path: '_doc/demo.db'
|
}
|
|
import Api from '@/common/api.js'
|
Vue.prototype.$Api = Api// 2、挂载全局
|
|
App.mpType = 'app'
|
// 把 store 对象提供给 “store” 选项,这可以把 store 的实例注入所有的子组件
|
export const app = new Vue({
|
store,
|
...App
|
})
|
app.$mount()
|
// #endif
|
|
// #ifdef VUE3
|
import { createSSRApp } from 'vue'
|
export function createApp() {
|
const app = createSSRApp(App)
|
return {
|
app
|
}
|
}
|
// #endif
|