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事件,对象没有绑定

  • 相关阅读:
    pandas函数
    实战应用--基于物品的协同过滤算法itemCF
    Hadoop--mapreduce知识点总结
    HDFS知识点总结
    学习随笔 --python连接oracle数据库
    学习随笔 --python实现熵权法
    学习随笔 --SparkStreaming WordCount Python实现
    学习随笔 --SparkStreaming WordCount Java实现
    学习随笔--JavaSparkJDBC操作Oracle
    Anaconda和canda简介及区别
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/10279496.html
Copyright © 2011-2022 走看看