当前位置: 首页 > news >正文

昌平区网站建设公司凡科互动游戏修改器

昌平区网站建设公司,凡科互动游戏修改器,房产网系统,华为云免费服务器Vue使用 IndexDB vue操作IndexDB数据库 Vue操作IndexDB数据库 Vue使用 IndexDB vue操作IndexDB数据库 Vue操作IndexDB数据库安装 IndexDB类库引入 localForage测试 新增数据、获取数据 Vue使用 IndexDB vue操作IndexDB数据库 Vue操作IndexDB数据库 大部分场景使用 LocalStore都… Vue使用 IndexDB vue操作IndexDB数据库 Vue操作IndexDB数据库 Vue使用 IndexDB vue操作IndexDB数据库 Vue操作IndexDB数据库安装 IndexDB类库引入 localForage测试 新增数据、获取数据 Vue使用 IndexDB vue操作IndexDB数据库 Vue操作IndexDB数据库 大部分场景使用 LocalStore都足够了但是 如果要考虑大数据的话LocalStore支持并不是很好有内存限制并且数据过大 LocalStore解析和存储性能不是很好这时候可以使用 IndexDB数据格式 是和 数据库一样可以创建多个数据库数据库里面有多个表 安装 IndexDB类库 原生 IndexDB操作API并不是很方便可以使用第三方类库可以极大的减少工作量调用IndexDB和LocalStore API很像我这边使用过的是 LOCALFORAGE 官网 支持存储类型有 npm npm install localforag或者 使用 yrm yarn add localforage引入 localForage 在 main.js 中引用 import Vue from vue import App from ./App import router from ./router// IndexDB封装类库 https://localforage.github.io/localForage/#installation import localforage from localforageVue.use(localforage)// 将 localforage 挂载到全局示例, 这样就可以在任何地方 用 this.$localforage 操作 Vue.prototype.$localforage localforageconsole.info(localforage初始化成功使用 this.$localforage 调用)// 创建一个 默认的 IndexDB数据库挂载到全局 const demoDataBase localforage.createInstance({name: demoDataBase })Vue.prototype.$demoDataBase demoDataBase console.info(默认数据库 demoDataBase 初始化成功使用 this.$demoDataBase 调用)Vue.config.productionTip falsenew Vue({el: #app,router,components: { App },template: App/ }) 测试 新增数据、获取数据 在 demoDataBase数据库新增一条数据 // 操作 demoDataBase数据库this.$demoDataBase.setItem(测试demoDataBase, 我是测试值).then(function (value) {// Do other things once the value has been saved.console.log(value)}).catch(function (err) {// This code runs if there were any errorsconsole.log(err)})// 不需要回调this.$demoDataBase.setItem(测试demoDataBase2, 我是测试值2) 查看是否生效数据已经新增上去了一共两条 获取数据也很简单 // 操作 demoDataBase数据库this.$demoDataBase.getItem(测试demoDataBase).then(function (value) {// Do other things once the value has been saved.console.log(value)}).catch(function (err) {// This code runs if there were any errorsconsole.log(err)})// 不需要回调this.$demoDataBase.getItem(测试demoDataBase2)还有删除、查询等更多API不一一演示了可以进入官网 查看更多
http://www.zqtcl.cn/news/980781/

相关文章:

  • 渭南网站开发做网红用哪个网站
  • 湖北建设网站wordpress 翻页电子书
  • 网站设计命名规范厦门建站比较好的公司
  • 用vs2010做网站登入前端培训费用大概多少郑州
  • 网站建设后的效果评估杭州网站制作公司
  • 3网站建设公司影楼修图用什么软件
  • 手机网站的内容模块多用户商城开源左
  • 库尔勒网站建站宝盒合作
  • 五河网站建设哪家好wordpress获取文章作者
  • 怎么修改网站内容wordpress ajax接口
  • 绵阳市城乡建设和规划局网站重庆网站建设公司有哪些
  • 宿迁网站建设公司排名展厅设计企业
  • 做家具定制的设计网站开阿里巴巴网站建设流程
  • 站长统计软件广州免费核酸在哪里做
  • 做soho一定要做网站吗在百度网站备案查询上显示未备案是什么意思
  • 移动公司营销网站设计html旅游网站模板
  • 专业生产车间设计图纸网站ui设计师证
  • 如何建网站教程视频10种网络营销方法
  • 网站内链优化的角度wordpress缓存插件破解版
  • 南宁网站建设哪个好天津网站建设咨询
  • 网站开发常用中间件计算机语言python
  • 学习html5的网站软件系统开发怎样容易
  • 做企业网站用什么华为弹性云服务器创建wordpress
  • 重庆手机网站开发网站建设的条件是什么
  • 舟山建设网站公司wordpress的总结
  • 如何做com的网站做网站设计学那个专业好
  • 中山如何建设网站如何安装wordpress模板
  • 如何搭建自己得网站树状wordpress主题
  • 公司网站是别人做的如何换logo北京网站设计浩森宇特
  • 直播网站制作做阿里巴巴网站电话