layui的本地存储方法介绍


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

//复杂操作

layui.data('cate', {

        key: 'data',

        value: [

            {date: 'id', id: 1, content:'00000'}

            ,{date: 'id', id: 2, content:'11111'}

            ,{date: 'id', id: 3, content:'22222'}

            ,{date: 'id', id: 4, content:'33333'}

            ]

    });

     

    //追加数据

    var cates = layui.data('cate').data;

    cates.push({date: 'id', id: 5, content:'4444444'});

     

    //移除数据

    cates.splice(2,1);

     

    //更新操作

    layui.data('cate', {

        key: 'data',

        value: cates

    });

     

    console.info(layui.data('cate'));

更多layui知识请关注layui使用教程栏目。

以上就是layui的本地存储方法介绍的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

使用layui框架封装ajax模块的具体步骤

详解layui单选按钮不能正常显示及解决办法

layui有什么好处

layui怎么使用jquery

layui模块使用规范(附代码)

layui中的table方法渲染

layui修改弹出层按钮颜色的方法

采用layui的美化时保留select里面的change事件

layui打开的layer的iframe窗口怎么关闭

layui怎么做图片在列表中显示

更多相关阅读请进入《layui》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...