gpt4 book ai didi

html - 谁能告诉我为什么这段代码没有创建到本地存储的条目?

转载 作者:太空狗 更新时间:2023-10-29 15:45:39 24 4
gpt4 key购买 nike

var myLocalStore = Ext.getStore('Default');
myLocalStore.load();
var now = new Date();
var cardId = (now.getTime()).toString() + (this.getRandomInt(0, 100)).toString();
var entry1 = { id: cardId, dateCreated: now, title: 'The Title', narrative: 'the Text' };
myLocalStore.add(entry1);
myLocalStore.sync();
console.log(entry1);

控制台输出:

    Object{id: "136575772251069", dateCreated: Fri Apr 12 2013 17:08:42 GMT+0800 (Taipei Standard Time), title: "The Title", narrative: "the Text"}

最佳答案

更新:成功!

我将代码更新为如下所示;

var myLocalStore = Ext.getStore('Default');
var now = new Date();
var cardId = (now.getTime()).toString() + (this.getRandomInt(0, 100)).toString();
var entry = Ext.create('PinYin.model.Default', {id: cardId, dateCreated: now, title: "test", narrative: "narrative"});
entry.save();
console.log(entry);

关于html - 谁能告诉我为什么这段代码没有创建到本地存储的条目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21704897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com