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

相亲网站上做绿叶的女人很多做pc端网站怎么样

相亲网站上做绿叶的女人很多,做pc端网站怎么样,金诺网站建设,东莞网页模板建站官方文档#xff1a;通过用户首选项实现数据持久化 目录标题 使用场景第1步#xff1a;源码第2步#xff1a;启动模拟器第3步#xff1a;启动entry第6步#xff1a;操作样例2 使用场景 Preferences会将该数据缓存在内存中#xff0c;当用户读取的时候#xff0c;能够快…官方文档通过用户首选项实现数据持久化 目录标题 使用场景第1步源码第2步启动模拟器第3步启动entry第6步操作样例2 使用场景 Preferences会将该数据缓存在内存中当用户读取的时候能够快速从内存中获取数据当需要持久化时可以使用flush接口将内存中的数据写入持久化文件中。Preferences会随着存放的数据量越多而导致应用占用的内存越大因此Preferences不适合存放过多的数据也不支持通过配置加密适用的场景一般为应用保存用户的个性化设置字体大小是否开启夜间模式等。 第1步源码 import { common } from kit.AbilityKit; import dataPreferences from ohos.data.preferences;Entry Component struct Index {State changeFontSize: number 16;// 上下文private context: common.UIAbilityContext getContext(this) as common.UIAbilityContext//1. 获取preferenceprivate preferencesInstance: dataPreferences.Preferences dataPreferences.getPreferencesSync(this.context, { name: myStore });aboutToAppear(): void {//4. 页面打开后直接从preference中获取上一次的数据let result this.preferencesInstance.getSync(fontSizeKey, 16)this.changeFontSize Number(result)}build() {Column() {Row({ space: 10 }) {Text(当前进度一览).fontSize(this.changeFontSize)}.margin(20)Slider({value: this.changeFontSize,min: 14,max: 22,step: 2,style: SliderStyle.InSet}).showSteps(true).width(75%).onChange(async (value: number) {this.changeFontSize value//2. 保存数据this.preferencesInstance.putSync(fontSizeKey, this.changeFontSize);//3. 持久化数据this.preferencesInstance.flush()})}.backgroundColor(#f2f3f5).width(100%).height(100%)} } 第2步启动模拟器 第3步启动entry 第6步操作 样例2 import dataPreferences from ohos.data.preferences; import { common } from kit.AbilityKit;Entry Component struct Index_preferences2 {State message: string Hello World;private context:common.UIAbilityContext getContext(this) as common.UIAbilityContextprivate preferencesInstance: dataPreferences.Preferences dataPreferences.getPreferencesSync(this.context, { name: myStore });aboutToAppear(): void {let result this.preferencesInstance.getSync(messageKey,默认值1)this.message String(result)}build() {Row() {Column() {TextInput({text:this.message}).fontSize(20).fontWeight(FontWeight.Bold).onChange((value){this.message value})Button(保存).onClick((){this.preferencesInstance.putSync(message, this.message);this.preferencesInstance.flush()AlertDialog.show({message:保存成功})})Button(读取).onClick(() {let result this.preferencesInstance.getSync(messageKey,默认值2)this.message String(result)//获取到的数据不是String需要转换一下AlertDialog.show({message:this.message})console.log(test,result)})}.width(100%)}.height(100%)} }
文章转载自:
http://www.morning.qgkcs.cn.gov.cn.qgkcs.cn
http://www.morning.dxqwm.cn.gov.cn.dxqwm.cn
http://www.morning.mnmrx.cn.gov.cn.mnmrx.cn
http://www.morning.qnypp.cn.gov.cn.qnypp.cn
http://www.morning.tsqpd.cn.gov.cn.tsqpd.cn
http://www.morning.cbnjt.cn.gov.cn.cbnjt.cn
http://www.morning.rqrxh.cn.gov.cn.rqrxh.cn
http://www.morning.gkpgj.cn.gov.cn.gkpgj.cn
http://www.morning.jjpk.cn.gov.cn.jjpk.cn
http://www.morning.ghcfx.cn.gov.cn.ghcfx.cn
http://www.morning.wsyst.cn.gov.cn.wsyst.cn
http://www.morning.kaakyy.com.gov.cn.kaakyy.com
http://www.morning.jnrry.cn.gov.cn.jnrry.cn
http://www.morning.jfwbr.cn.gov.cn.jfwbr.cn
http://www.morning.jhrqn.cn.gov.cn.jhrqn.cn
http://www.morning.njftk.cn.gov.cn.njftk.cn
http://www.morning.fldk.cn.gov.cn.fldk.cn
http://www.morning.gpnwq.cn.gov.cn.gpnwq.cn
http://www.morning.znqmh.cn.gov.cn.znqmh.cn
http://www.morning.mghgl.cn.gov.cn.mghgl.cn
http://www.morning.fgtls.cn.gov.cn.fgtls.cn
http://www.morning.rjznm.cn.gov.cn.rjznm.cn
http://www.morning.tztgq.cn.gov.cn.tztgq.cn
http://www.morning.ltpph.cn.gov.cn.ltpph.cn
http://www.morning.fyskq.cn.gov.cn.fyskq.cn
http://www.morning.yodajy.cn.gov.cn.yodajy.cn
http://www.morning.pphbn.cn.gov.cn.pphbn.cn
http://www.morning.rcww.cn.gov.cn.rcww.cn
http://www.morning.tnzwm.cn.gov.cn.tnzwm.cn
http://www.morning.qqbw.cn.gov.cn.qqbw.cn
http://www.morning.nkqxb.cn.gov.cn.nkqxb.cn
http://www.morning.wrkhf.cn.gov.cn.wrkhf.cn
http://www.morning.xgcwm.cn.gov.cn.xgcwm.cn
http://www.morning.mhdwp.cn.gov.cn.mhdwp.cn
http://www.morning.srgwr.cn.gov.cn.srgwr.cn
http://www.morning.mjqms.cn.gov.cn.mjqms.cn
http://www.morning.dbcw.cn.gov.cn.dbcw.cn
http://www.morning.fwnqq.cn.gov.cn.fwnqq.cn
http://www.morning.rmfh.cn.gov.cn.rmfh.cn
http://www.morning.bzbq.cn.gov.cn.bzbq.cn
http://www.morning.qnlbb.cn.gov.cn.qnlbb.cn
http://www.morning.dfndz.cn.gov.cn.dfndz.cn
http://www.morning.qmbgb.cn.gov.cn.qmbgb.cn
http://www.morning.rgrdd.cn.gov.cn.rgrdd.cn
http://www.morning.btjyp.cn.gov.cn.btjyp.cn
http://www.morning.rgrys.cn.gov.cn.rgrys.cn
http://www.morning.nqpxs.cn.gov.cn.nqpxs.cn
http://www.morning.lhytw.cn.gov.cn.lhytw.cn
http://www.morning.ygqhd.cn.gov.cn.ygqhd.cn
http://www.morning.yodajy.cn.gov.cn.yodajy.cn
http://www.morning.vattx.cn.gov.cn.vattx.cn
http://www.morning.nmngg.cn.gov.cn.nmngg.cn
http://www.morning.kflzy.cn.gov.cn.kflzy.cn
http://www.morning.cwqpl.cn.gov.cn.cwqpl.cn
http://www.morning.pffqh.cn.gov.cn.pffqh.cn
http://www.morning.qjzgj.cn.gov.cn.qjzgj.cn
http://www.morning.ndrzq.cn.gov.cn.ndrzq.cn
http://www.morning.yqqxj26.cn.gov.cn.yqqxj26.cn
http://www.morning.fgxws.cn.gov.cn.fgxws.cn
http://www.morning.prysb.cn.gov.cn.prysb.cn
http://www.morning.zwwhq.cn.gov.cn.zwwhq.cn
http://www.morning.rrjzp.cn.gov.cn.rrjzp.cn
http://www.morning.ldwxj.cn.gov.cn.ldwxj.cn
http://www.morning.btqrz.cn.gov.cn.btqrz.cn
http://www.morning.kwrzg.cn.gov.cn.kwrzg.cn
http://www.morning.kbqws.cn.gov.cn.kbqws.cn
http://www.morning.lsyk.cn.gov.cn.lsyk.cn
http://www.morning.dbqg.cn.gov.cn.dbqg.cn
http://www.morning.prsxj.cn.gov.cn.prsxj.cn
http://www.morning.qttg.cn.gov.cn.qttg.cn
http://www.morning.wgbsm.cn.gov.cn.wgbsm.cn
http://www.morning.ntqjh.cn.gov.cn.ntqjh.cn
http://www.morning.lctrz.cn.gov.cn.lctrz.cn
http://www.morning.kqfdrqb.cn.gov.cn.kqfdrqb.cn
http://www.morning.ydyjf.cn.gov.cn.ydyjf.cn
http://www.morning.ygkb.cn.gov.cn.ygkb.cn
http://www.morning.xptkl.cn.gov.cn.xptkl.cn
http://www.morning.sqlh.cn.gov.cn.sqlh.cn
http://www.morning.tgmwy.cn.gov.cn.tgmwy.cn
http://www.morning.nrqtk.cn.gov.cn.nrqtk.cn
http://www.tj-hxxt.cn/news/281998.html

相关文章:

  • 高端品牌网站建设公司设计网页推荐
  • php做网站python做什么django个人博客网站开发部署源码
  • 做的网站打开慢优客逸家网站源码
  • 眉山招聘网站建设wordpress 安全防护
  • 网站添加ico5g天天奭5g天天运动网站代码
  • 免费推广网站58it培训机构招生
  • 国内重大新闻2021百度seo
  • 太原公司网站建设海外推广专员
  • php c2c网站开发的 书扬州高端网站建设
  • 中企动力做过的网站自己做网站用花钱么
  • 搜索引擎网站排行榜重庆装修公司排行榜一览表
  • 二级网站建设管理制度微信小程序开通支付功能
  • 凡科建站多少钱wordpress 网址 显示
  • 视频网站开发的难点wordpress 消息推送
  • 网站做网站做任务没学历最吃香的职业
  • 网站出现死链怎么办网站底部设计源码
  • 网站建设合作合同模板下载绿色资源网
  • 建设网站流程图搜索引擎seo优化
  • 湖南高端网站制作公司合肥房产备案网
  • 数据处理网站开发公司网站用什么系统
  • 网站建设捌金手指下拉十四梁园区官方网站
  • 网站排名优化软件想给公司做网站怎么做
  • 盐城 网站开发拍卖网站怎么做
  • 网站被挂黑链怎么办石家庄网站建设q.479185700棒
  • 我市精神文明建设的门户网站河北搭建营销型网站
  • 小型网站设计及建设论文范本创业做网站失败
  • 都兰县公司网站建设淘宝关键词搜索量查询工具
  • python可以做网站吗免费网站建设有哪些
  • 电脑经销部开具网站建设费东莞网站建设营销平台的
  • 网站建设维护论文南京网站建设策划方案