CountdownInstall

安装

Examples
自动倒计时
自动倒计时
<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
手动模式
手动模式
<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

属性

名字类型默认值说明版本要求
valuenumber时间,秒为单位--
startbooleantrue是否开始计数--


贡献者

贡献者

该组件(包含文档)迭代次数 5,贡献人数 1

airyland

Changelog

发布日志

  • v2.0.0 [deprecated] 下一版本开始不再维护