2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-23 06:40:35 +03:00

docs: add i18n doc

This commit is contained in:
mengxiong10
2019-11-10 22:35:32 +08:00
parent 657c23eeab
commit fc1a8c16f8
3 changed files with 114 additions and 0 deletions
+37
View File
@@ -57,6 +57,43 @@ $ npm install vue2-datepicker --save
</template>
```
## Internationalization
The default language of v3.x is English. If you need other locales.
You can import locale file.
Once you import a locale, it becomes the active locale.
```js
import DatePicker from 'vue2-datepicker';
import 'vue2-datepicker/index.css';
import 'vue2-datepicker/locale/zh-cn';
```
You can override the default locale by `lang`.
[Full config](https://github.com/mengxiong10/vue2-datepicker/blob/master/locale.md)
```html
<script>
export default {
data() {
return {
lang: {
formatLocale: {
firstDayOfWeek: 1,
},
monthBeforeYear: false,
},
};
},
};
</script>
<template>
<date-picker :lang="lang"></date-picker>
</template>
```
### Props
| Prop | Description | Type | Default |