Comments (9)
假设场景:有 A、B两个页面,其中 A 页面为入口打开页面,在A页面ready后调用 .$preload("B")
会触发B页面类级别(还取不到页面实例)的 onPreload 调用,在 onPreload 里发起请求获取数据,就实现了数据的预加载。
from wxpage.
请问,在B页面获取数据后,如何进行保存呢,this.$setData() 方法不可用,有没有好的方法
from wxpage.
你可以从文档里了解下 $put 与 $take 方法:
from wxpage.
请问这个 $put $cookie $session 这3者的区别有哪些,或者这样说,在哪些场景下使用比较合适
from wxpage.
没有操作cookie,只有$cache
三者的区别在于:
- $put 是内存级别的缓存,可以存放任何的对象实例、包括引用值或者是函数
- $session 是基于本地缓存实现的临时缓存,小程序关闭后(一般是微信进程重启)会清空
- $cache 是永久缓存,微信卸载了会清空(或者程序的清空缓存)
from wxpage.
请问小程序只能通过 setDate的方式修改页面上的值吗
from wxpage.
小程序的 setData 应该算是唯一的更新接口..
from wxpage.
该框架 $cache 有删除的方法吗
from wxpage.
目前没有删除的方法,$cahce.set(key, null | '') 效果也是一样的
from wxpage.
Related Issues (20)
- 小程序体验提示存在定时器未跟随页面回收 HOT 5
- this.$cache方法中不能调用$route么? HOT 1
- 支持分包配置么? HOT 10
- this.$setData()不支持回调? HOT 2
- this.$cache怎么删除缓存 HOT 1
- 大大能否考虑添加typescript支持呢 HOT 1
- 个人原因 HOT 4
- 请问extendPageBefore和extendPageAfter的区别以及注意事项? HOT 1
- $session 之类的辅助函数能否单独引用 HOT 1
- 关于npm引入wxpage在小程序里使用的问题 HOT 18
- onAppShow只执行一次 HOT 5
- 请问这段代码是什么意思啊?完全看不懂 HOT 2
- 库中无用代码的优化 HOT 9
- QQ小程序截至0.1.27版本仍需要补全页面json HOT 7
- 请问,有木有跨级多层组件的通讯,props传递的方案呀 HOT 2
- session的疑问 HOT 3
- queue函数的疑问 HOT 2
- component.js函数的疑问
- $name 和 $curPageName() 的疑问
- 希望大神有时间修改下,跳转有时失效的问题 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wxpage.