欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

I18n在VUE中使用方法

程序员文章站 2022-05-15 23:46:20
...

语言包:

export default {
    route: {
        dashboard: 'Dashboard',
        system: 'System'
    },
    member:{
        name: 'Member',
        member:{
            column:{
                id: {
                    name: 'Id',
                    placeholder: '@:(util.validator.input)@.lower:(member.creditActivity.column.id.name)',
                    validator: {
                        required: '@.lower:(member.creditActivity.column.id.name)@:(util.validator.required)'
                    }
                },
            }
        }
    }
}

index.js

export const listColumns = [
  { prop: 'id', label: i18n.t('system.role.column.id.name'), visible: true, sortable: true },
  { prop: 'name', label: i18n.t('system.role.column.name.name'), visible: true },
  { prop: 'statusName', label: i18n.t('system.role.column.status.name'), visible: true },
  { prop: 'description', label: i18n.t('system.role.column.description.name'), visible: true }
]

html:

<el-form-item :label="$t('loan.channel.column.type.name')" prop="type">
            <parameter-select v-model="item.type" :placeholder="$t('loan.channel.column.type.placeholder')" parent-id="03" :is-number="true" />
</el-form-item>


<div>{{ $t('util.button.cancel') }}</div>

js:

this.$t('member.credit.activity.review.approve')