Vue – CLI old project using LocaleProvider internationalization component in [Ant Design of Vue] error. The error content and version are as follows:

【 a 】 :

Version Information:

"vue": "^ 2.6.10"."ant-design-vue": "^ 1.3.13"."@vue/cli-plugin-babel": "^ 3.9.0"."@vue/cli-plugin-eslint": "^ 3.9.0"."@vue/cli-service": "^ 3.9.0"."@vue/eslint-config-airbnb": "^ 4.0.0".Copy the code

Foreground code:

<template> <a-locale-provider :locale="locale"> <div id="app"> <div class="sky"><Nav /></div> <router-view></router-view> </div> </a-locale-provider> </template> <script> import Vue from 'vue'; import Antd from 'ant-design-vue'; import Nav from './components/Nav'; import {mapState} from 'vuex'; Vue.use(Antd); export default {... }Copy the code

【 2 】 :

Version Information:

"vue": "^ 2.6.11." "."ant-design-vue": "^ 1.7.5." "."@vue/cli-plugin-babel": "~ 4.5.0." "."@vue/cli-plugin-eslint": "~ 4.5.0." "."@vue/cli-service": "~ 4.5.0." ".Copy the code

Foreground code:

Same as above

[Solution] (The solution is the same in both cases)

The important thing is to replace the

tag with

<template>
    <a-config-provider :locale="locale">
    <div id="app">
        <div class="sky"><Nav /></div>
        <router-view></router-view>
    </div>
    </a-config-provider>
</template>
Copy the code