怎樣用 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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM