首页 > 其他 > 详细

vue props默认值国际化报错

时间:2020-08-17 14:42:17      阅读:203      评论:0      收藏:0      [点我收藏+]

未做国际化处理

    tabLabel: {
      type: Array,
      default: () => (["a", "b", "c"])
    }

初次国际化处理 出现报错

    tabLabel: {
      type: Array,
      default: () => ([this.$t(‘status.a‘), this.$t(‘status.b‘), this.$t(‘status.c‘)])
    }

修改之后国际化处理

    tabLabel: {
      type: Array,
      default () {
        return [this.$t(‘status.a‘), this.$t(‘status.b‘), this.$t(‘status.c‘)]
      }
    }

vue props默认值国际化报错

原文:https://www.cnblogs.com/samsara-yx/p/13517230.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!