vue3
项目中,element-plus
的日期选择器 el-date-picker
默认是英文版的,如下:
页面引入:
//引入汉化语言包
import locale from "element-plus/lib/locale/lang/zh-cn"
import {
ElDatePicker, ElButton, ElConfigProvider } from 'element-plus/lib/components'
用 el-config-provider
包裹组件 el-date-picker
:
<el-config-provider :locale="locale">
<el-date-picker v-model="searchList.end_time" type="date" placeholder="请选择结束时间" value-format="yyyy-mm-dd"/>
</el-config-provider>
完整代码,index.tsx
:
import {
defineComponent, ref, reactive, onMounted } from 'vue'
import styled from '@/styled-components'
import {
Popover } from 'ant-design-vue';
//引入汉化语言包
import locale