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

网站服务器错误怎么办简约手机网站源码

网站服务器错误怎么办,简约手机网站源码,网站内容结构,网站建设银川需求#xff1a;使用uniapp#xff0c;模拟key#xff08;表名#xff09;增删改查对象数组#xff0c;每个key可以单独操作#xff0c;并模拟面对对象对应表#xff0c;每个key对应的baseInstance 类似一个操作类#xff0c;当然如果你场景比较简单#xff0c;可以改…需求使用uniapp模拟key表名增删改查对象数组每个key可以单独操作并模拟面对对象对应表每个key对应的baseInstance 类似一个操作类当然如果你场景比较简单可以改为固定key或者传值key调普通js而不需要new base.js export default {data() {return {}},methods: {// 一是不需要new来调用二是参数非常灵活可以不传也可以这么传createBaseStore(key) {return new this.baseInstance(key || {})},// 函数创建对象 每个key对应自己的方法 达到实例化效果 使用 baseInstance.addExt(obj) 自动携带固定keybaseInstance(key) {this.dataKey key;this.addExt function addExt(obj) {var dataList this.getAllExt()if (dataList null) {dataList new Array()}var newItemid 0const last dataList.length - 1if (last 0) {newItemid dataList[last].id 1}obj.id newItemiddataList.push(obj)this.save(dataList)}this.removeExt function removeExt(param) {var dataList this.getAllExt();var findItemIndex dataList.findIndex(item {if (item.id param) {return true}})if (findItemIndex 0) {const newList dataList.splice(findItemIndex, 1)console.log(remove item is index, findItemIndex, JSON.stringify(newList))this.save(dataList)} else {console.log(not find remove param, param)}}this.changeExt function changeExt() {console.log(change)}this.searchExt function searchExt() {console.log(search)}this.save function save(dataList) {var dataJson JSON.stringify(dataList)uni.setStorage({key: key,data: dataJson,success: function() {console.log(key:, key, addExt success, dataJson);console.log(curr size, dataList.length);}});}this.getAllExt function getAllExt() {try {const value uni.getStorageSync(this.dataKey);if (!value) {console.log(getAllExt is empty);return null}const dataBean JSON.parse(value)if (dataBean) {return dataBean}} catch (e) {console.log(showAllToLogExt error, e);}return null}this.showAllToLogExt function showAllToLogExt() {try {const value this.getAllExt();if (value) {console.log(showAllToLogExt, value);}} catch (e) {console.log(showAllToLogExt error, e);}}},clearAllExt() {console.log(clearAllExt)uni.clearStorage()}}} vue使用 templateviewview classuni-flex uni-row style-webkit-justify-content: center;justify-content: center;button typedefault v-on:clickshowAllToLog()showAllToLog/buttonbutton typedefault v-on:clickadd()add/buttonbutton typedefault v-on:clickremove()remove/buttonbutton typedefault v-on:clickchange()change/buttonbutton typedefault v-on:clicksearch()search/buttonbutton typedefault v-on:clickclearAll()clearAll/button/view/view /templatescriptimport base from /pages/base/base.jsexport default {mixins: [base],data() {return {title: demo学习,TestBean: {id: 0,a: ,b: ,c: ,},dataExt: {},dataExt2: {},storeInstance1: this.createBaseStore(key111),storeInstance2: this.createBaseStore(key222),indexId: 0}},onload() {getAllExt()},methods: {showAllToLog() {this.storeInstance1.showAllToLogExt()this.storeInstance2.showAllToLogExt()},add() {// 操作类型1实例 存对象2到对象数组2var currentTime new Date();this.dataExt.name 111this.dataExt.goodsTime currentTimethis.storeInstance1.addExt(this.dataExt)// key1Store.remove// key1Store. 等等操作// 操作类型2实例 存对象2到对象数组2this.dataExt2.name param2this.dataExt2.param2Time currentTimethis.storeInstance2.addExt(this.dataExt2)},remove() {// 模拟后续加上id即可目前只是掩饰this.storeInstance1.removeExt(4)this.storeInstance2.removeExt(4)},change() {this.changeExt()},search() {this.searchExt()},clearAll() {this.clearAllExt()},}} /scriptstyle/style
http://www.hkea.cn/news/14312231/

相关文章:

  • 郑州网站优化外包进行网站建设视频
  • 中国交通建设集团有限公司网站苏州网站制作价格
  • 小型企业网站建设报告北京网站设计制作招聘信息
  • 做设计在哪个网站上找高清图片大全请问做卖东西网站怎么
  • .帮别人做网站百度网站推广服务商
  • 网站做营销推广2345手机浏览器
  • 个人博客模板网站简单的网页制作软件
  • 营销网站建设的公司哪家好普洱专业企业网站建设
  • 网站视频怎么做的好处wordpress 新建表
  • 广州住房保障城市建设局网站石家庄昨天下午出了大事
  • 聊城 网站制作江门市亿阳科技有限公司
  • 长沙一键建站系统宁波seo外包优化
  • 做打鱼网站犯法不广东省网站设计师
  • 烟台 网站建设wordpress 加载字体
  • 网站制作行业越来越难做阿里云装wordpress
  • 易名网站备案故城县网站建设服务
  • 网站自动屏蔽恶意点击吉林市网站制作
  • 沈阳制作网站网站建设代理政策
  • 怎么介绍网站的优缺点投票网站模板
  • 简约智能设备制造公司网站北京海淀区信息科技有限公司
  • 重庆主城优化网站建设单页面的网站
  • 河南省做网站的公司有哪些网上怎么注册公司免费的
  • 哪些网站做的比较炫建筑方案设计网站
  • 做视频包的网站网站建设预算项目
  • 做移动网站快速天津虚拟现实制作公司
  • 深圳腾网站建设外贸建站应该怎么做
  • 花生壳做局域网站网页设计html代码大全咋结啥
  • 阿里云 网站备案商业空间设计师岗位职责
  • 网站策划做啥众筹网站怎么做推广方案
  • 请问我做吉利网站吉利啊导航网站备案