Jam*_*mie 9 google-chrome-extension google-chrome-storage
我有4件我想要的东西,但我不确定如何分开钥匙.使用逗号会出错.以下是我的用法示例:
chrome.storage.sync.get({
'customImage',
'customColor',
'customRandColor',
'customRandImage'
}, function(backgroundCheckedOptions) {
document.getElementById('optionsCustomImage').checked = backgroundCheckedOptions.customImage;
document.getElementById('optionsBackgroundColor').checked = backgroundCheckedOptions.customColor;
document.getElementById('optionsRandomColor').checked = backgroundCheckedOptions.customRandColor;
document.getElementById('optionsRandomImage').checked = backgroundCheckedOptions.customRandImage;
});
Run Code Online (Sandbox Code Playgroud)
我原以为他们会用逗号分开,但我猜不是.
Zig*_*del 13
从Chrome存储文档中可以看出:
StorageArea.get(字符串或字符串或对象键数组,函数回调)
最简单的是通过更换你传递一个数组{}与[]
| 归档时间: |
|
| 查看次数: |
3570 次 |
| 最近记录: |