Coder Social home page Coder Social logo

vueye-timeline's Introduction

Vueye Timeline

It's a cool and a responsive Vue.js component used to show item set in chronological display.

Installation

npm i vueye-timeline --save

Usage

<template>
  <div id="app">
    <VueyeTimeline :items="items">
      <template v-slot:content="{item}">
        <h2>{{item.title}}</h2>
        <div>{{item.body}}</div>
      </template>
      <template v-slot:opposite="{item}">
        <h1 :style="{color:item.styleConfig.background}">{{item.year}}</h1>
      </template>
    </VueyeTimeline>
  </div>
</template>
    </VueyeTimeline>
</div>
</template>

<script>
import VueyeTimeline from "VueyeTimeline";
export default {
  name: "App",
  data: () => ({
    items: [
      {
        title: "Item 1",
        body:
          "Lorem ipsum, dolor sit amvoluptate sunt eveniet ducimus totam doloribus neque vitae nam quasi atque quisquam similique unde, nemo ipsum molestiae?",
        year: 2010,

        styleConfig: {
          background: "#ffc1bd",
          color: "#545454",
          dotColor: "#2244e9"
        }
      },
      {
        title: "Item 2",
        body:
          "Lorem ipsum, dolor sit amvoluptate sunt eveniet ducimus totam doloribus neque vitae nam quasi atque quisquam similique unde, nemo ipsum molestiae?",
        year: 2014,

        styleConfig: {
          background: "#e7d8ff",
          color: "#545454",
          dotColor: "#2244e9"
        }
      },
      {
        title: "Item 3",
        body:
          "Lorem ipsum, dolor sit amvoluptate sunt eveniet ducimus totam doloribus neque vitae nam quasi atque quisquam similique unde, nemo ipsum molestiae?",
        year: 2016,

        styleConfig: {
          background: "#673AB7",
          color: "#eee",
          dotColor: "#2244e9"
        }
      },
      {
        title: "Item 4",
        body:
          "Lorem ipsum, dolor sit amvoluptate sunt eveniet ducimus totam doloribus neque vitae nam quasi atque quisquam similique unde, nemo ipsum molestiae?",
        year: 2019,

        styleConfig: {
          background: "#CDDC39",
          color: "#545454",
          dotColor: "#2244e9"
        }
      }
    ]
  }),

  methods: {},
  components: {
    VueyeTimeline
  }
};
</script>

<style lang="scss">
#app {
  height: 100%;
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  // justify-content: center;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
}

pre {
  margin-top: 20px;
  padding: 10px;
  color: #fff;
  background: #7e06ad;
}
</style>

Demo

Timeline Demo

props and directives

prop description default
items the item set provided to []

items config:

each item could have the following structure :

-title : the item title which is shown in bold style

-body : the item content.

-styleConfig : the item style like background, color and width.

Slot

content

Customize the default content display.

opposite

Define the display and the style of the opposite content.

vueye-timeline's People

Contributors

boussadjra avatar

Stargazers

 avatar  avatar  avatar  avatar Pascal Tbf avatar Slimane Amiar avatar Mohamed Azouaoui avatar Matej avatar toDev avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.