CountdownInstall

Install

Examples
Automatic countdown
Automatic countdown
<template>
  <div>
    <group :title=" $t('Automatic countdown') ">
      <cell title="15s" v-model="value">
        <countdown v-model="time" @on-finish="finish" v-show="show"></countdown>
      </cell>
    </group>
  </div>
</template>

<script>
import { Countdown, Group, Cell } from 'vux'

export default {
  components: {
    Countdown,
    Cell,
    Group
  },
  data () {
    return {
      show: true,
      time: 15,
      value: ''
    }
  },
  methods: {
    finish (index) {
      this.show = false
      this.value = 'completed'
      console.log('current index', index)
    }
  }
}
</script>


Show code
Manually
Manually
<template>
  <div>
    <group :title=" $t('Manually') ">
      <x-switch :title=" $t('Start') " v-model="start"></x-switch>
      <cell title="15s">
        <countdown v-model="time" :start="start" @on-finish="finish"></countdown>
      </cell>
    </group>
  </div>
</template>

<script>
import { Countdown, Group, Cell, XSwitch } from 'vux'

export default {
  components: {
    Countdown,
    Cell,
    Group,
    XSwitch
  },
  data () {
    return {
      time: 15,
      value: '',
      start: false
    }
  },
  methods: {
    finish (index) {
      this.start = false
      this.time = 20
    }
  }
}
</script>


Show code
API

Props

nametypedefaultdescriptionrequired version
valuenumbertotal sections--
startbooleantrueif start counting down--


Contributors

Contributors

Total commits quantity: 5,Total contributors quantity: 1

airyland

Changelog

Releases

  • v2.0.0 [deprecated] This component is no longer maintained