elementUI里CheckBox组件的change回调如何在使用自定义传参的条件下保留默认传参?

2019-06-27 09:30:44

同问,有什么办法保留默认传参

找到解决办法了。

@change="checked=>方法名(checked,你想传的额外参数...)"

实例

<el-checkbox :disabled="scope.row.disable" v-model="scope.row.cashStatus"
                       @change="checked=>checkRow(checked, scope.row)"></el-checkbox>
                       
checkRow(checked,row) {    console.log(`checked:${checked}`)    console.log(`row:${JSON.stringify(row)}`)
  },

控制台结果:

checked:truerow:{"name":"FB 周日","disable":false,"cashStatus":true,"netStatus":false}


  • 2017-02-24 16:53:58

    PHP 中的Closure

    Closure,匿名函数,又称为Anonymous functions,是php5.3的时候引入的。匿名函数就是没有定义名字的函数。这点牢牢记住就能理解匿名函数的定义了。

  • 2017-03-02 09:45:27

    动态加载js和css

    开发过程中经常需要动态加载js和css,今天特意总结了一下常用的方法。