zoukankan      html  css  js  c++  java
  • Vue重置当前页面数据

    问题:在做一个列表页面的时候,有一些input或select作为筛选条件来查询,加了一个重置功能,要清空这些数据 

    使用了vue的这个方法来清除 Object.assign(this.$data.params,this.$options.data().params);

    重置时发现在报错,报错原因是params里面有route的传值:this.$route.params.batchNumber

    1       params: {
    2         batchNo: this.$route.params.batchNumber? this.$route.params.batchNumber : null,
    3         orderId: null,
    4         isRepeat: null,
    5         loanOrderStatus: null,
    6         page: 1,
    7         pageSize: 10,
    8       },

    后来查找原因,参考这篇文章解决;

    https://blog.csdn.net/mocoe/article/details/89682022

    改成这样子,Object.assign(this.$data.params, this.$options.data.call(this).params);问题解决

  • 相关阅读:
    什么是云安全
    VMWare vForum 2013看点
    循环和数据的操作命令
    程序交互
    数据类型
    基础变量
    模块和包
    ['hello', 'sb']正则表达式
    os模块
    内置函数
  • 原文地址:https://www.cnblogs.com/tanweiwei/p/13072139.html
Copyright © 2011-2022 走看看