@10up/countdown-timer 中文文档教程

发布于 3年前 浏览 37 项目主页 更新于 3年前

10up Countdown Timer component

一个倒数计时器组件,它显示在组件的 datetime 属性中指定的时间之前(或之后经过的时间)剩余的时间量。

Installation

npm install --save @10up/countdown-timer

查看此包的官方文档

Markup

这是组件期望的标记模板。 要倒计时到您当地时区 2046 年元旦的午夜:

<time class="countdown-timer" datetime="2046-01-01T00:00:00">
    <!-- Some fallback content, perhaps the date string itself or a message to users or machines that can't view this component with JS. -->
</time>

Usage

通过提供用于组件的选择器和包含任何必要回调函数的对象来创建一个新实例。

import CountdownTimer from '@10up/countdown-timer';

new CountdownTimer( '.countdown-timer', {
    // Settings and callback properties go here.
} );

Demo

实施示例:https

Support Level

://baseline.10up.com/component/countdown-timer/ Active: 10up 正在为此积极努力,我们希望在可预见的未来继续努力,包括保持测试到最新版本的 WordPress。 欢迎错误报告、功能请求、问题和请求请求。

Like what you see?

10up

10up Countdown Timer component

A countdown timer component that displays the amount of time remaining until (or elapsed since) the time specified in the component's datetime attribute.

Installation

npm install --save @10up/countdown-timer

View official documentation for this package

Markup

This is the markup template expected by the component. To count down to midnight on New Year's Day in the year 2046 in your local time zone:

<time class="countdown-timer" datetime="2046-01-01T00:00:00">
    <!-- Some fallback content, perhaps the date string itself or a message to users or machines that can't view this component with JS. -->
</time>

Usage

Create a new instance by supplying the selector to use for the component and an object containing any necessary callback functions.

import CountdownTimer from '@10up/countdown-timer';

new CountdownTimer( '.countdown-timer', {
    // Settings and callback properties go here.
} );

Demo

Example implementations at: https://baseline.10up.com/component/countdown-timer/

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Like what you see?

10up

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文