pqina / flip

⏳ The online version of the classic flip clock
https://pqina.nl/flip/
MIT License
892 stars 87 forks source link

how to set new value #68

Open anabrnjasevic opened 11 months ago

anabrnjasevic commented 11 months ago

Hi, I'm having trouble with changing the initial value of the counter, I'm using Vue 3, composition API. As I understand the documentation, value should update when it changes?

  hours: Number,
  minutes: Number,
  seconds: Number,
});

onMounted(() => {
  var element = document.querySelector("#tick");
   tick = Tick.DOM.create(element, {
    value: {
        sep:':',
        seconds:props.seconds,
        hours:props.hours,
        minutes:props.minutes,
    },

    didInit: function (tick) {
      console.log("hello!",tick);
    },
    });
});

onUnmounted(() => {
  Tick.DOM.destroy(tick);
});

any help would be appreciated...

WillsB3 commented 3 months ago

Did you try setting value on the Tick instance…?

e.g. tick.value = x.