Files
ZhHealth/main.js

55 lines
1.1 KiB
JavaScript

/*
* @Description:
* @Author: Aimee·Zhang
* @Date: 2022-01-05 09:01:12
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-12 16:35:13
*/
import App from './App'
import Vue from 'vue'
import store from './store'
import uView from 'uview-ui'
import filters from './utils/filters.js'
import {
router,
RouterMount
} from 'router'
import {
usqlite
} from '@/uni_modules/onemue-USQLite/js_sdk/usqlite.js'
import {
contactModel
} from '@/utils/im/models.js'
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Vue.use(uView);
Vue.use(router)
Vue.config.productionTip = false
Vue.prototype.$store = store
usqlite.connect({
name: 'zh-health', // 数据库名称
path: '_doc/health.db', // 路径
}, (err, res) => {
uni.getStorage({
key: 'FIRST_RUN',
fail: () => {
contactModel.create((err, res) => {
console.error('SQLITE 创建表格', err, res)
uni.setStorageSync('FIRST_RUN', true)
})
}
})
})
App.mpType = 'app'
const app = new Vue({
store,
...App
})
app.$mount()