this.list?. 用法

this.list?.[index+1]

 

这个写法叫做    可选链操作符

 

但是:

需要在babel里面设置,vue需要引入babel。

你可能感兴趣的:(笔记,javascript)