案例1:
element-ui中的table组件,可能会发现有这么一个写法:
table里对应的data数据
template(模版) 在这里属于一个固定用法:<template slot-scope="scope">
通过scope.row.date,我们就可以读取到每一行中的date。
案例2:
另外关于scope.row,scope.$index案例
总结:
slot-scope="scope" //取到当前单元格
scope.$index //拿到当前行的index
scope.row //拿到当前行的数据对象
scope.row.date //是对象里面的data属性的值
关于<template slot-scope="scope">
目前我还没有理解得很透彻,后面再补充。