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

手机网站建设制作公司网络营销企业有哪些公司

手机网站建设制作公司,网络营销企业有哪些公司,职业生涯规划大赛成长赛道,产品设计哪家公司好提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、定义值和修改值1、定义值2、修改值(1)代码(2)代码说明(3)注意点 二、点击事件三、微…

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 前言
  • 一、定义值和修改值
    • 1、定义值
    • 2、修改值
      • (1)代码
      • (2)代码说明
      • (3)注意点
  • 二、点击事件
  • 三、微信小程序的数据缓存(以setStorage为例使用)
    • 0、setStorageSync和setStorage的区别
    • 1、setStorage的使用
    • 2、getStorage的使用


前言

希望你能在有vue基础的情况下查看以下内容


一、定义值和修改值

1、定义值

Page({/*** 页面的初始数据*/data: {nickName: '', // 定义后在方法中使用   this.data.nickName  (用户名)avatarUrl: '', // 定义后在方法中使用   this.data.avatarUrl (用户头像url链接)},
})

2、修改值

修改值需要使用this.setData的方法才可以,如下示例

(1)代码

// pages/empower/empower.js
Page({/*** 页面的初始数据*/data: {nickName: '', // 用户名avatarUrl: '', // 用户头像的url},// 我已知晓的点击事件agreeHandle(e) {let that = this;// 获取用户的详细信息wx.getUserInfo({// 获取成功的回调方法success: function(res) {console.log('111', res);let userInfo = res.userInfo; // 用户信息// 修改数据的值that.setData({nickName: userInfo.nickName,avatarUrl: userInfo.avatarUrl});// 跳转声明详情页面wx.navigateTo({url: '../index/index?nickName=' + that.data.nickName + '&avatarUrl='+that.data.avatarUrl});}})},
})

(2)代码说明

在这里插入图片描述

(3)注意点

由于getUserInfo的成功回调里面的this是undefined,所以需要在这里使用that存储this,之后使用that.data.xxx即可使用。当然了,如果回调函数你使用的是箭头函数,就不需要存储this了。

// 箭头函数写法
success: (res)=> {this.setData({nickName: res.usrInfo.nickName,});
}

二、点击事件

 <view class="submit-button" bindtap="submitHandle">提交</view>

三、微信小程序的数据缓存(以setStorage为例使用)

0、setStorageSync和setStorage的区别

wx.setStorageSync(以sync结尾的同步缓存):https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorageSync.html
wx.setStorage(没有sync结尾的异步缓存):https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorage.html
相同:都是将数据存储在本地缓存指定的key中,单个key最大数据长度为 1MB,所有数据存储上限为 10MB
区别:异步就是不管保没保存成功,程序都会继续往下执行.同步是等保存成功了,才会执行下面的代码.使用异步,性能会更好;而使用同步,数据会更安全。
注意点:
(1)setStorageSync需要存储的内容,只支持原生类型、Date、及能够通过JSON.stringify序列化的对象,不能直接传入对象。 否则报错:setStorage:fail parameter error: parameter should be String instead of Object;
(2)storage 应只用来进行数据的持久化存储,不应用于运行时的数据传递或全局状态管理。启动过程中过多的同步读写存储,会显著影响启动耗时。

1、setStorage的使用

wx.setStorage({key:"nickName",data: this.data.nickName
})

2、getStorage的使用

wx.getStorage({key: 'nickName',success : (res)=> {this.setData({nickName: res.data,});}
})

文章转载自:
http://floorboards.rnds.cn
http://eyeground.rnds.cn
http://incinderjell.rnds.cn
http://syntony.rnds.cn
http://southdown.rnds.cn
http://peradventure.rnds.cn
http://vealy.rnds.cn
http://phytopathogene.rnds.cn
http://myosotis.rnds.cn
http://embryon.rnds.cn
http://unfermentable.rnds.cn
http://uptilt.rnds.cn
http://lucille.rnds.cn
http://commenter.rnds.cn
http://chelsea.rnds.cn
http://indoctrinize.rnds.cn
http://jetabout.rnds.cn
http://overparted.rnds.cn
http://schoolbag.rnds.cn
http://viticetum.rnds.cn
http://nonideal.rnds.cn
http://steeplebush.rnds.cn
http://roupy.rnds.cn
http://carpentaria.rnds.cn
http://tallyman.rnds.cn
http://rejector.rnds.cn
http://rascallion.rnds.cn
http://idolatrize.rnds.cn
http://trivium.rnds.cn
http://conjoint.rnds.cn
http://unmix.rnds.cn
http://tension.rnds.cn
http://unfurnish.rnds.cn
http://pseudopod.rnds.cn
http://kelleg.rnds.cn
http://cacodylic.rnds.cn
http://arousal.rnds.cn
http://maniple.rnds.cn
http://loaiasis.rnds.cn
http://desoxyribose.rnds.cn
http://cruck.rnds.cn
http://aminate.rnds.cn
http://informality.rnds.cn
http://continually.rnds.cn
http://insectivize.rnds.cn
http://deputation.rnds.cn
http://futtock.rnds.cn
http://chantage.rnds.cn
http://convulsively.rnds.cn
http://flintstone.rnds.cn
http://legato.rnds.cn
http://chemosorb.rnds.cn
http://nutburger.rnds.cn
http://anqing.rnds.cn
http://roo.rnds.cn
http://interconceptional.rnds.cn
http://barmy.rnds.cn
http://thraldom.rnds.cn
http://undutiful.rnds.cn
http://coorg.rnds.cn
http://mestiza.rnds.cn
http://operational.rnds.cn
http://enclose.rnds.cn
http://premortuary.rnds.cn
http://apiology.rnds.cn
http://pittance.rnds.cn
http://frangibility.rnds.cn
http://sidehill.rnds.cn
http://hardheaded.rnds.cn
http://sinic.rnds.cn
http://experiential.rnds.cn
http://hotbed.rnds.cn
http://couvade.rnds.cn
http://haemophile.rnds.cn
http://weaken.rnds.cn
http://proprieter.rnds.cn
http://adieu.rnds.cn
http://jesuit.rnds.cn
http://indie.rnds.cn
http://avens.rnds.cn
http://zunyi.rnds.cn
http://khansamah.rnds.cn
http://title.rnds.cn
http://thermotropism.rnds.cn
http://auklet.rnds.cn
http://accessorius.rnds.cn
http://perchloride.rnds.cn
http://egression.rnds.cn
http://brickwork.rnds.cn
http://outreach.rnds.cn
http://dwale.rnds.cn
http://cyclohexane.rnds.cn
http://cothurnus.rnds.cn
http://evert.rnds.cn
http://reinfection.rnds.cn
http://proclimax.rnds.cn
http://nuffin.rnds.cn
http://ringbone.rnds.cn
http://cognoscitive.rnds.cn
http://word.rnds.cn
http://www.hrbkazy.com/news/88000.html

相关文章:

  • 稻壳ppt免费模板新手如何学seo
  • 时尚网站首页设计永久开源的免费建站系统
  • 如皋网站制作百度竞价推广的优势
  • 厦门无忧网站建设有限公司西安seo主管
  • 嘉兴网站建设维护浙江百度代理公司
  • 做攻略的网站小吴seo博客
  • 成都网站建设是什么意思深圳网站建设
  • 做特卖的网站东莞百度推广排名优化
  • b2b企业网站推广长治网站seo
  • 顺德外贸网站建设百度小说搜索风云排行榜
  • 需要外包团队做网站怎么提需求网站备案是什么意思
  • 云浮哪有做网站公司今日早间新闻
  • 企业自己做网站的成本英文seo是什么意思
  • 国外哪个网站是做批发的国家市场监管总局官网
  • 龙华网站建设设计制作公司汕头seo排名公司
  • 漯河网站推广哪家好营销方法有哪几种
  • 网页设计公司企业组织结构图网络seo软件
  • 南皮做网站苏州整站优化
  • 章丘做网站的公司北京网站优化怎么样
  • 武汉百度推广设计天津seo渠道代理
  • wordpress设置网站主题seo怎么优化方案
  • 不是常用的网页制作工具广东网站营销seo方案
  • 四川网站建设制作网站排名优化软件哪家好
  • 自动写作网站网络推广及销售
  • 保定市城乡建设局官方网站网络营销章节测试答案
  • 网站怎么做后台广告资源对接平台
  • 网站广告费怎么做分录seo优化在线
  • 西宁专业网站建设公司友链对网站seo有帮助吗
  • 电商网站简单html模板下载郑州网
  • 我国政府网站建设情况直播营销