antoniandre / vue-cal-v4

A Vue.js full calendar, no dependency, no BS. :metal:
https://antoniandre.github.io/vue-cal-v4/
MIT License
1.25k stars 235 forks source link

Can't use watchRealTime #572

Closed berkecyln closed 6 months ago

berkecyln commented 8 months ago

Hello, it might be a silly question however I cannot solve how can use watchRealTime in my project I have the vueCal component used by another page and ı want to use watchRealTime but ı can't figure out how ı should use it I tried several things but nothing is worked and ı can't find any usage example in API document. Can anyone please explain to me? I tried these:


.vuecal__watch-real-time{
  default: true ;
}

.vuecal__now-line {
  color: #06c;
  watchRealTime: true;
}

<template>
  <vue-cal 
  :events="allEvents" 
    active-view="week" 
    :disable-views="['years', 'year']" 
    :watch-real-time="true"
    events-on-month-view="short"
    today-button
    style="height: 600px; width: 80%">
  </vue-cal>
</template>

none of the three worked, Thank you for your help.

antoniandre commented 6 months ago

Hi @berkecyln, Watching the real time only takes :watch-real-time="true". Your attempts in CSS will never work and are not valid CSS. The watch-real-time prop only keeps the current time marker accurate over time. It's an option to have it or not because having a timer to keep sync is an expensive process. https://antoniandre.github.io/vue-cal/#ex--today-current-time