zoukankan      html  css  js  c++  java
  • xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

    js & Object reference bug

    bug

    object ref bug

    
        onClickButton (type = ``) {
            let {
                publishDate: publishTime,
                newsTitle: xwbt,
                mediaSource: mtcc,
                columnCategory: lmfl,
                // priority: yxj,
                processingStatus: dataStatus,
                processingPersonnel: handleUser,
                newsId,
            }= this.commonFilters;
            // update
            let commonFiltersPagination = this.commonFilters;
            // object ref bug ???
            this.commonFiltersPagination = commonFiltersPagination;
            console.log(`this.commonFiltersPagination bug =`, JSON.stringify(this.commonFiltersPagination, null, 4));
            let {
                // current,
                size,
            } = this.pagination;
            // init
            this.pagination.current = 1;
            console.log(`this.pagination.current =`, this.pagination.current);
            let options = {
                publishTime,
                xwbt,
                mtcc,
                lmfl,
                // yxj,
                dataStatus,
                handleUser,
                newsId,
                current: 1,
                size,
            };
            this.getCommonTableDatas(options);
        },
    
    

    solution & Object 解构赋值

    OK

        onClickButton (type = ``) {
            let {
                publishDate: publishTime,
                newsTitle: xwbt,
                mediaSource: mtcc,
                columnCategory: lmfl,
                // priority: yxj,
                processingStatus: dataStatus,
                processingPersonnel: handleUser,
                newsId,
            }= this.commonFilters;
            // update
            // let commonFiltersPagination = this.commonFilters;
            // object ref bug ???
            // this.commonFiltersPagination = commonFiltersPagination;
            // this.commonFiltersPagination = commonFiltersPagination;
            this.commonFiltersPagination = {...this.commonFilters};
            console.log(`this.commonFiltersPagination bug =`, JSON.stringify(this.commonFiltersPagination, null, 4));
            let {
                // current,
                size,
            } = this.pagination;
            // init
            this.pagination.current = 1;
            console.log(`this.pagination.current =`, this.pagination.current);
            let options = {
                publishTime,
                xwbt,
                mtcc,
                lmfl,
                // yxj,
                dataStatus,
                handleUser,
                newsId,
                current: 1,
                size,
            };
            this.getCommonTableDatas(options);
        },
    
    

    notes

    明白了,第一次没有出发 click事件,对象没有绑定

  • 相关阅读:
    4.变量与运算符
    2.python的基本数据类型
    bzoj 2337: [HNOI2011]XOR和路径
    bzoj 2109: [Noi2010]Plane 航空管制
    bzoj 1566: [NOI2009]管道取珠
    bzoj 3439: Kpm的MC密码
    bzoj 2957: 楼房重建
    十、mysql之索引原理与慢查询优化
    九、MySQL 5.7.9版本sql_mode=only_full_group_by问题
    八、多表查询
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/10279496.html
Copyright © 2011-2022 走看看