1.0.20 • Published 3 years ago

vue-stories v1.0.20

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Installation 🚀

npm

npm install vue-stories

yarn

yarn add vue-stories

Import

import VueStories from 'vue-stories';

Usage👨‍💻

<template>
  <div @click="openStories">
  
  <VueStories
    :avatarImage=""
    :avatarTitle=""
    :stories="[]" 
    :isPause=true 
    :header=true
    :isSave=true
    ref="vueStories"
    v-on:onNextFrame="actionOnNext"
    v-on:onPreviousFrame="actionOnPrevious"
    v-on:onComplete="actionOnComplete"
    v-on:onFullscreen="actionOnFullscreen"
    v-on:onSave="actionOnSave"
/>
</template>

<script>
  import VueStories from 'vue-stories';

  export default {
    name: 'App',
    
    components: { VueStories },
    
    data() {
      return {
      
        strories:[
          {
            id: String || Number ,
            url: String ,
            title: String ,
            subTitle: String,
            styles:{
              backgroundSize:'contain',  
          }
        ]
      }
    },
    
    methods: {
      //open vue stories
      openStories(){
           this.$refs.vueStories.toggle_fullscreen(true)
      },
      
      actionOnNext(id)
      actionOnPrevious(id)
      actionOnComplete(id)
      actionOnFullscreen(status)
      actionOnSave(status, id)
    }
  };
</script>

Props

PropTypeDescriptionDefault value
avatarImageStringImage for your avatar/assets/sample.png
avatarTitleStringTitle fo your avatar''
storiesArrayList of the stories[]
isPauseBooleanPause the story or nottrue
headerBooleanShow the header or nottrue
isSaveBooleanShow the save button or nottrue

Events

Event nameUsage
onNextFrameReturns id of the previous frame
onPreviousFrameReturns the id of the next frane
onCompleteReturns the id of the last frame
onSaveReturns true or false with the current frame id

Support the project ⭐

If you like my work please share and give a star

1.0.2

3 years ago

1.0.1

3 years ago

1.0.20

3 years ago

1.0.0

3 years ago