Socket
Book a DemoInstallSign in
Socket

time-axis-auto

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time-axis-auto

It is a automtic timeline component.

0.1.4
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

time-axis-auto

Project setup

npm install time-axis-auto --save

运行效果

在线demo https://www.benpaodehenji.com/timeline

Use

main.js

import 'time-axis-auto'

test.vue

<template>
      <time-axis-auto
      :options="options"
      :dateTimes="dateTimeList"
      @getDateFun="getDateFun"
      :interval="interval"
    ></time-axis-auto>
</template>
<script>
export default {
  data() {
    return {
      date: '',
      options: {
        speed: 1, // 速度
        speedMax: 10 // 速度最大值
      },
      interval: 50, // 日期间的间隔
     dateTimeList:[]
    }
  },
  created(){
    this.initTimeLine()
  },
  methods: {
        // 时间轴数据初始化
    initTimeLine() {
      let count = 0
      while (count < 24) {
        const timeRes = count < 10 ? `0${count}:00` : `${count}:00`
        this.dateTimeList.push(timeRes)
        count++
      }
    },
    getDateFun(time) {
      console.log(time)
    }
  }
}
</script>

The case reference https://www.jianshu.com/p/fb51fe44ff47

Keywords

timeLine

FAQs

Package last updated on 27 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.