怎样用 vue-i18n这个结合vue的$t来实现通过data传值的翻译

<el-row class="searchForm">
      <template v-for="(item,index) in searchConfig" :gutter="20">
        <el-col :key="index" :span="6">
          <!-- <span>{{ item.placeholder }}:</span> -->
          <span>{{ $t('table["'+ item.placeholder +'"]') }}:</span>
          <el-input v-if="item.type == 'input'" v-model="listQuery[item.dataModel]" style="width:calc(100% - 100px)" class="filter-item" />
          <el-select v-if="item.type == 'select'" v-model="listQuery[item.dataModel]" style="width:calc(100% - 100px)" clearable class="filter-item">
            <el-option v-for="(item2,index2) in item.options" :key="index2" :label="item2.label" :value="item2.value" />
          </el-select>
        </el-col>
      </template>
    </el-row>

主要是 

<span>{{ $t('table["'+ item.placeholder +'"]') }}:</span>
posted @ 2019-05-05 19:56  missLiuliu  阅读(2949)  评论(0编辑  收藏  举报