1.1.2 • Published 4 years ago

vue-tv v1.1.2

Weekly downloads
32
License
-
Repository
github
Last release
4 years ago

vue-tv(vue-spatial-navigation)

Focus library for smart Tv application using Vue js and mitt(event-bus);

  • Supports only Vue-2

Live demo

Screenshots

Getting Started

npm install vue-tv

List

import {FocusableList} from "vue-tv";

<List
    :child="Button" //custom component
    :isFocused="true" //to set focus
    :items="items" //array to loop
    v-on:onFocusChange="onFocusHandler"
  />

List with disabled

<List
    :child="Button" 
    :isFocused="true" 
    :items="items" 
    :disabledIndex=[0,2,3] //index
  />

Nested Carousel

<List
    :child="child"
    :isFocused="true"
    :items="items"
    :shouldScroll="true"
    orientation="VERTICAL"
  />
  ...
  
  data() {
    return {
      items: [
        {
          child: Card,
          shouldScroll: true,
          items: carouselData[0],
        },
        {
          child: Card,
          shouldScroll: true,
          items: carouselData[1],
        },
      ],
      child: List,
      shouldScroll: true,
    };
  },

Grid

<Grid
    :child="Card"
    :isFocused="true"
    :items="items"
    :shouldScroll="true"
    :maxColumn="4"
  />

Props

NameTypeRequiredDescriptionDefault
childVue ComponenttrueChild widget to display on each index of list/grid
itemsArraytrueArray to loop through[]
isFocusedBooleantrueTo set focus & make it navigatablefalse
defaultIndexintfalseInitial index to be focused-1
disabledBooleanfalseTo disable the navigationfalse
disabledIndexArrayfalsearray of indices to disable in the list[-1]
orientationenumfalseDirection of list and navigation.'HORIZONTAL','VERTICAL'HORIZONTAL
shouldScrollBooleanfalseTo make list scroll as you navigatefalse
idStringfalseUnique Id to handle navigationMath.random().toString()

Readme will be updated soon!

Please check the examples folder for reference for now.

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago