简体   繁体   中英

customize vuejs datepicker for bootstrap 3

Currently vuejs datepicker for boostrap 3 looks like this:

在此处输入图片说明

As you can see, we have a label 2018 April . What I need is to change that label into April 2018 .

I saw that the component doesn't have any API reference that can help me with that. Any ideas?

My solution would be to find a way to modify the plugin but that is the last solution.

indeed, you can't. From the source code of your plugin: https://github.com/wxsms/uiv/blob/master/src/components/datepicker/DateView.vue

2018 April is coded as <b>{{yearMonthStr}}</b> . This is a computed property defined as follow:

yearMonthStr () {
    return isExist(this.month) ? `${this.year} ${this.t(`uiv.datePicker.month${this.month + 1}`)}` : this.year
},

So as you say, it's complicated and you might have to modify the plugin. You could make a pull request to the project adding an option to the component to customize the month.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM