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

  • 相关阅读:
    使用 Docker 部署 Spring Boot
    阿里云Redis开发规范
    Java开发包Jedis
    Jedis的配置和优化
    JVM调优前戏之JDK命令行工具---jhat
    JVM调优前戏之JDK命令行工具---jstack
    JVM调优之经验
    Logback配置文件这么写,TPS提高10倍
    Java开发包Jedis
    Error Handling in ASP.NET Core
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/10279496.html
Copyright © 2011-2022 走看看