# vue-i18n **Repository Path**: qiukyjava/vue-i18n ## Basic Information - **Project Name**: vue-i18n - **Description**: 亲测,非常实用 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-07 - **Last Updated**: 2021-08-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue-i18n + element-ui 多语言配置 ## Project setup ``` npm install ``` ### Compiles and hot-reloads for development ``` npm run serve ``` ### Compiles and minifies for production ``` npm run build ``` ### Lints and fixes files ``` npm run lint ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). ### 页面引用 #### 1、 ``` ``` #### 2、 ``` ``` #### 3、 ``` watch: { '$i18n.locale': { handler: function() { this.rules.userName[0].message = this.$t('enterUserName'); this.rules.password[0].message = this.$t('enterLoginPassword'); this.rules.phone[0].message = this.$t('enterPhone'); this.rules.phone[1].message = this.$t('enterRightPhone'); this.rules.code[0].message = this.$t('enterCode'); this.$refs.loginForm.clearValidate(); this.$refs.mobileForm.clearValidate(); }, } } > ``` #### 4、 ``` watch: { '$i18n.locale': { handler: function() { this.rules.userName[0].message = this.$t('enterUserName'); this.rules.password[0].message = this.$t('enterLoginPassword'); this.rules.phone[0].message = this.$t('enterPhone'); this.rules.phone[1].message = this.$t('enterRightPhone'); this.rules.code[0].message = this.$t('enterCode'); this.$refs.loginForm.clearValidate(); this.$refs.mobileForm.clearValidate(); }, } } > ```