weex
weex copied to clipboard
Uncaught TypeError: storage.setItem is not a function
调用本地存储报错 Uncaught TypeError: storage.setItem is not a function 难道是因为版本的问题? weex --version info 0.4.5
var storage = require('@weex-module/storage');
storage.setItem('bar', 'bar-value', function(e) {
// callback.'e' is an object that contains 'result' and 'data'. e.result indicate wether `setItem` is succeed.
// e.data will return 'undefined' if success or 'invalid_param' if your key/value is ""/null.
});
@Rowandjj @pythons
@jiangyoucai 是在哪个平台报的问题? weex sdk版本是多少?检查下sdk里是否有storagemodule。
@jiangyoucai SDK 0.7.0 才支持 storage 哦。
@luics close 吧,@jiangyoucai 他的版本是 v0.4.5, 不支持 storage