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

  • 相关阅读:
    Android学习第三天
    Android学习第二天(从零开始手动创建项目)
    【k8s】Pod-containers
    【k8s】Pod-Guaranteed
    【k8s】Pod-Burstable
    【k8s】Pod-BestEffort
    【k8s】Pod-qosClass
    【k8s】Pod-readinessGates
    【k8s】Pod-containerStatuses
    【k8s】Pod-conditions
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/10279496.html
Copyright © 2011-2022 走看看