0.0.6 • Published 5 years ago

@mvpleung/flipclock v0.0.6

Weekly downloads
20
License
MIT
Repository
github
Last release
5 years ago

FlipClock

flipclock for Vue,Rejecting jQuery dependency

Installation

FlipClock.js can be installed in the following ways:

Node (NPM)

npm install @mvpleung/flipclock -S

Script (Vue)

<script src="path/dist/index.js"></script>

Script (window)

<script src="path/src/flipclock.min.js"></script>

Demo & Documentation

Example

Vue Script Example

Website and documentation at http://flipclockjs.com/


Vue Demo

import { FlipClock } from '@mvpleung/flipclock';
export default {
  ...
  components: {
    FlipClock
  }
}

...

<flip-clock :options="{}" />

Documentation

FieldTypeDescription
digitNumberdeprecated, An integer used to start the clock(Use Options.digit instead)
optionsObjectflipclock configuration, Support dynamic modification options to change flipclock

Options

Website and documentation at http://flipclockjs.com/

FieldTypeDescription
timeNumberSource of time
digitNumberAn integer used to start the clock(For Example: countdown-to-new-years)
labelBooleanWhether or not a time label is displayed
dotBooleanWhether the time division dots are displayed
dividerObjectTime partition configuration, See below Divider Options
clockFaceStringThis is the name of the clock that is used to build the clock display. The default value is HourlyCounter
showSecondsBooleanDisplay seconds. The default value is true
......More configuration to see here http://flipclockjs.com

Divider Options

FieldTypeDescriptionExample
daysStringSegmentation between day and hour nodes, support HTML,<span class='custom-days'>天</span>
hoursStringSegmentation between hourly and minute nodes, support HTML小时,<span class='custom-hours'>小时</span>
minutesStringSegmentation between minute and second nodes, support HTML分钟,<span class='custom-minutes'>分</span>
secondsStringSecond unit,<span class='custom-seconds'>秒</span>

Instance Methods

this.$refs.flipclcok.start();

MethodParamsDescription
triggerevent,paramsTrigger FlipClock Method
startcallbackStart the clock
stopcallbackStop the clock
resetoptions,callbackReset the clock, If the options is present, the clock will be reset by the options
loadClockFacename, optionsThis method allows you to load a clock face. The first argument is the name of the clock face, and the second is an object of options used to override the default properties.
loadLanguagenameThis method allows you to load a language file. The argument is the name of the language file.
setCountdowncountdownThis method set the clockdown property to true or false. In addition to setting the property, this method will also change the direction the clock is flipping.
getTimeThis method will get the current FlipFactory.Time object.
setTimetimeThis method will set the time on the clock by passing a value which will be passed to the FlipFactory.Time object.
instanceThis method will get the current FlipClock object.

License


LICENSE

0.0.6

5 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago