filter中的this

时间:2021-08-25 18:26:34   收藏:0   阅读:16

项目中遇到 后端返回属性  而我需要根据属性 转换成对应的常量的功能  常量存于js文件中

想要使用 filter   return  this.$constant.XXX[属性名] 来进行转换  发现提示  $constant of undefined

filter 中不存在 this  想要用this 可以用 mehods 或 computed 方法

原文:https://www.cnblogs.com/shirunfeng/p/15184608.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!