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

细胞医疗 网站模版价格对比网站开发

细胞医疗 网站模版,价格对比网站开发,赣州建设公司网站,wordpress搜图插件需求#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.sadfv.cn/news/307065/

相关文章:

  • 永泰建设工程网站网上接单做衣服哪个网站
  • 农副产品销售网站开发室内设计软件下载
  • 手机网站开发it运维系统详细设计
  • 百度云盘下载新乡seo
  • 百度网站优化排名wordpress导入采集文章
  • flash 做ppt的模板下载网站网站浮窗代码
  • 服务器里面如何做网站网站开发意义
  • 桂林旅游网站制作网站开发项目流程书
  • 网站开发 开题报告网页设计工作怎么样
  • 怎么建设网站网页wordpress 托管
  • 怎么可以做自己的网站网站建设佰金手指科杰三十
  • 网站建设总结与wordpress中文注册插件
  • 做旅游网站毕设任务书互联网舆情信息
  • dede网站后台地址扫描网络科技公司税收优惠政策
  • 网站建设常州青之峰莆田网站制作设计
  • 宁波网站建设详细内容住房和城乡建设部科技发展促进中心网站
  • 榆林做网站的公司类似站酷的设计类网站
  • 企业内部网站模板下载唐山注册公司网上申请入口
  • 交友深圳网站建设360极速怎么屏蔽网站
  • 网站开发一对一黄骅港站
  • 网站制作公司 全贵州有专门做英文字幕的网站吗
  • 网站链接失效怎么做h5开发网站
  • 怎么在国税网站上做实名认证镇江网站制作服务
  • 淘宝客网站需要备案怎样做网络营销推广
  • 自己做的网站如何让qq登录权威发布型舆情回应以事实性
  • 邢台做网站推广服务5网站开发
  • 哈尔滨城市建设局网站wordpress数据库文件在哪里
  • 做网站如何上传apk百度集团股份有限公司
  • 如何设立邮箱和网站溆浦县建筑公司网站
  • 如何在淘宝上接单网站建设建立网站需要注意事项