wenzheng.yang
2023-04-27 31e64e0e144815e6176c1b6b81eae8dc68688570
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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