0.1.4 • Published 6 years ago

modal-fullscreen-vue v0.1.4

Weekly downloads
30
License
-
Repository
-
Last release
6 years ago

modal-fullscreen-vue

Project setup

npm install modal-fullscreen-vue

How to import

Import globally in main.js:

import ModalFullScreenVue from 'modal-fullscreen-vue'

Vue.use(ModalFullScreenVue)

// or custom use name
Vue.use('my-custom-name', ModalFullScreenVue)

Or import in component context:

<script>
  import ModalFullScreenVue from 'modal-fullscreen-vue'

  export default {
    components: {
      'modal-fullscreen-vue': ModalFullScreenVue
    }
  }
</script>

How to use

<template>
  <div>
    <button @click="show = true">Show</button>
    <ModalFullScreen :show="show" v-on:show="handleShow">
      <template slot="header">
        header
      </template>

      <template slot="body">
        <div v-for="n in 1000" :key="n">
          Body {{ n }}
        </div>
      </template>

      <template slot="footer">
        <button @click="show = false">Close</button>
      </template>
    </ModalFullScreen>
  </div>
</template>

<script>
  import ModalFullScreen from '../App.vue'

  export default {
    components: {
      // without custom name
      ModalFullScreen
    },

    data () {
      return {
        bodyText: 'Lorem Ipsum',
        show: true
      }
    },

    methods: {
      handleShow (show) {
        alert(`show: ${show}`)
      }
    }
  }
</script>

Props

NameType ValueDefault valueRequired
showBooleantrue
scrollableBooleantruefalse

Slots

NameDescription
headerEntire modal header content
bodyEntire modal body content (scrollable true is default if the body content exceeds the available height)
footerEntire modal footer content

Events

EventArgumentDescription
showshowBoolean value. True if modal trigger show
0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago