0👍
✅
As far as I know, Vue.js doesn’t have a built-in concept of a ‘selected’ element. You may be better off by using the date
returned by the day-click
event to figure out what the CSS selector is, and then using that to set the background-color. See below for some untested code based on the answer to a related SO question:
click: function(date, jsEvent, view) {
$("#red").css('background-color', 'red');
var moment = date.toDate();
MyDateString = moment.getFullYear() + '-'
+ ('0' + (moment.getMonth() + 1) ).slice(-2)
+ "-" +('0' + moment.getDate()).slice(-2);
$('[data-date='+MyDateString+']').css({'background-color', 'red'});
}
Source:stackexchange.com