当前位置: 首页 > 工具软件 > Count_Down > 使用案例 >

van-count-down 小程序如何使用van-count-down

夏飞鹏
2023-12-01

<span class="van-count-down-box">

            <van-count-down :time="overTime" />             

 </span>

获取时间,单位是毫秒,就不需要除以1000,

  接口的时间,我这里格式是 2021-12-01 23:59:59

let endTime = new Date(接口的时间).getTime()

let start_time = new Date().getTime();

this.overTime = endTime - start_time;//时间戳

css修改:

/deep/.van-count-down-box{

  .van-count-down{

    font-size: 14px !important;

    font-family: PingFang SC-Semibold, PingFang SC !important;

    font-weight: 600 !important;

    color: #FF521A !important;

    line-height: 20px !important;

  }

}

 类似资料: