@hyjiacan/vue-slideout

A Slide-Out component for Vue.js 2.0
56,778 99
Install
npm install @hyjiacan/vue-slideout@3.0.5
Latest Version:3.0.5
Vue:3
Older releases:2
License:MIT
Last Updated:Dec 8, 2023
Links: GitHub  ·  npm
Maintainer: hyjiacan

SlideOut

NPM Travis (.org) npm (scoped) npm bundle size (scoped) npm Coverage Status Badge

A Slide-Out component for Vue.js 2.0

Dependencies

  • Vue.js 2.x
  • Less

Install

NodeJS ENV (commonjs)

npm i @hyjiacan/vue-slideout

or

yarn add @hyjiacan/vue-slideout

You can get the latest code:

git clone https://github.com/hyjiacan/vue-slideout.git

or just download archive

Browser ENV (umd)

Since version 2.4.0

Unlike node env, a lowercase global slideout will be exploded.

The newest version

<script src="https://cdn.jsdelivr.com/npm/@hyjiacan/vue-slideout/lib/slideout.umd.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout/lib/slideout.css"
/>

Specified version

<script src="https://cdn.jsdelivr.com/npm/@hyjiacan/vue-slideout@<VERSION>/lib/slideout.umd.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@hyjiacan/vue-slideout@<VERSION>/lib/slideout.css"
/>

unpkg is also available: instead cdn.jsdelivr.net with unpkg.com

And you can use the uncompressed by instead slideout.umd.min.js with slideout.umd.js

Usage

Global (recommended)

main.js

import Vue from 'vue'
import SlideOut from '@hyjiacan/vue-slideout'
import '@hyjiacan/vue-slideout/lib/slideout.css'

// import SlideOut component, and set the defaults props
Vue.use(SlideOut, {
  // set props here
})

In Component

Foobar.vue

<template>
  <div>
    <slide-out :visible.sync="isVisible" @close="onClose">
      <div #header="{title}"></div>
      <div>content</div>
    </slide-out>
  </div>
</template>
<script>
  import SlideOut from '@hyjiacan/vue-slideout'
  import '@hyjiacan/vue-slideout/lib/slideout.css'

  export default {
    name: 'Foobar',
    components: { SlideOut },
    data() {
      return {
        isVisible: false
      }
    },
    methods: {
      onClose(e) {
        // prevent close and wait
        e.wait = true
        // close after 3 seconds
        setTimeout(() => {
          // assign true to close, do nothing or assign false to cancel close.
          e.close = true
        }, 3000)
      }
    }
  }
</script>

After version 2.6.0, property :visible.sync="isVisible" can be instead with v-model="isVisible".

Development

yarn
# start dev server
yarn serve
# Build library
yarn release

Related Packages

vue-swiper-component

a swiper component for vue

4,422 582
eagle.js

Slideshow framework for Vue.js

2,875 4,046
vue-agile

A carousel component for Vue.js

2,069,816 1,459
@ivanv/vue-collapse-transition

Custom Vue transition to collapse elements horizontally or vertically. Works wit...

531,911 108

Version History

Version Released License
3.0.5 MIT
3.0.3 MIT
3.0.2 MIT
3.0.1 MIT
3.0.0 MIT
Pre-releases (3)
Version Released License
3.0.0-beta3 MIT
3.0.0-beta2 MIT
3.0.0-beta1 MIT