出现场景

我们在使用 zb-table 表格组件的时候,有时候会通过 props 中的数据进行判断,但这时候在style 的回调方法中无法使用 this,这就很尴尬了。

解决方法

通过在全局定义 _this,然后在 created 钩子函数中将 this 赋值给 _this 即可。

zb-table 中单元格的 style 的回调方法 this为 undefined 的解决方法_前端