You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
774 B

4 years ago
import { name, version } from '@/config';
const install = Vue => {
Vue.prototype.$db.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
const request = window.indexedDB.open(name, version); // IDBRequest 对象
request.onerror = error => console.error('打开数据库失败', error);
request.onsuccess = event => {
Vue.prototype.$db.db = event.target.result;
};
request.onupgradeneeded = event => {
Vue.prototype.$db.db = event.target.result;
// 创建表
// user表
// projects项目表
// roles 角色表
// plan_tasks 定期任务
// fixed_tasks 固定全局任务
// variable_tasks 可变全局任务
// plugins 插件表
};
};
export default { install };