Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch remaining seconds #13

Open
putrafajarh opened this issue Mar 25, 2021 · 1 comment
Open

watch remaining seconds #13

putrafajarh opened this issue Mar 25, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@putrafajarh
Copy link

is there a way, to watch the remaining seconds?

I want to trigger class if remaining seconds below 5 minutes

this my components

<template>
  <vue-countdown-timer
    :start-time="startDate"
    :end-time="endDate"
    :interval="1000"
    :end-text="'Meet ended!'"
    @start_callback="startCallBack('event started')"
    @end_callback="endCallBack('event ended')"
  >
    <template slot="countdown" slot-scope="scope">
      <div class="text-white-80">
        <b-icon-clock-history></b-icon-clock-history> Durasi
        <span v-if="scope.props.days > 0" class="ct-num">{{ scope.props.days }}:</span
        ><span v-if="scope.props.hours > 0" class="ct-num">{{ scope.props.hours }}:</span
        ><span class="ct-num">{{ scope.props.minutes }}:</span><span class="ct-num">{{ scope.props.seconds }}</span>
      </div>
    </template>

    <template slot="end-text" slot-scope="scope">
      <span style="color: green">{{ scope.props.endText }}</span>
    </template>
  </vue-countdown-timer>
</template>

<script>
import { BIconClockHistory } from 'bootstrap-vue'
export default {
  name: 'Countdown',
  components: {
    BIconClockHistory,
  },
  props: {
    startDate: {
      type: String,
      required: true,
    },
    endDate: {
      type: String,
      required: true,
    },
  },
  methods: {
    startCallBack(x) {
      this.$emit('start', x)
    },
    endCallBack(x) {
      this.$emit('end', x)
    },
  },
}
</script>

<style>
.text-white-80 {
  color: rgba(255, 255, 255, 0.8) !important;
}
.ct-num {
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 1px;
}
</style>

@bennyxguo
Copy link
Owner

@putrafajarh So bascially you want to trigger a callback when the timer reach a certain limit? Is that correct?

If that's the case, currently the plugin doesn't support this feature, but seems like a good idea tho.

@bennyxguo bennyxguo self-assigned this Mar 27, 2021
@bennyxguo bennyxguo added the enhancement New feature or request label Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants