npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@burhanahmeed/vue-modal-2

v1.1.11

Published

A simple and lightweight Vue modal component.

Downloads

379

Readme

@burhanahmeed/vue-modal-2

npm version size npm

A simple and lightweight Vue modal component for Vue 2.x.

Documentation

Docs: https://initbase.github.io/vue-modal-2/

Demo

demo codesandbox

Install

yarn add @burhanahmeed/vue-modal-2

or

npm install @burhanahmeed/vue-modal-2

Usage

Vue-modal-2 usage for Vue 2.x

import Vue from "vue";
import App from "./App.vue";

import Modal from "@burhanahmeed/vue-modal-2";

Vue.use(Modal);

Vue.config.productionTip = false;

new Vue({
  render: (h) => h(App)
}).$mount("#app");

Usage in vue. If you didn't specify options.componentName, by default it will be <vue-modal-2></vue-modal-2>

<template>
  <vue-modal-2 name="modal-1" @on-close="close">
    Hello From Inside Modal Component
  </vue-modal-2>
</template>

API usage

methods: {
  open () {
    this.$vm2.open('modal-1')
  },
  close () {
    this.$vm2.close('modal-1')
  }
}

vue-modal-2 also accept options in .use() function as second argument.

options

options.componentName

  • type: String
  • default: vue-modal-2
Vue.use(Modal. {
  componentName: 'MyModal'
});
<template>
  <my-modal name="modal-1" @on-close="close">
    Hello From Inside Modal Component
  </my-modal>
</template>

Props

vue-modal-2 accept some props

name

unique name of the modal (required).

  • type: String
  • required: true
  • default: modal-1

@on-close or v-bind:on-close

props function using to close the modal (required).

  • type: function
  • required: true

see example above.

headerOptions

options props for vue-modal-2 header

  • type: Object
  • default: {}

headerOptions key:

|key|type|default|desc| |---|---|---|---| |headerOptions.title|String|Modal title| Modal title on the left side| |headerOptions.closeIcon|String|&#x2715;|Close button icon on the right side|

footerOptions

options props for vue-modal-2 footer

  • type: Object
  • default: {}

footerOptions key:

|key|type|default|desc| |---|---|---|---| |footerOptions.justify|String|flex-end| determine button position on the left or right| |footerOptions.btn1|String|Button 1|button one text. Button 1 is the one on the left side.| |footerOptions.btn2|String|Button 2|button two text. Button 2 is the one on the right side.| |footerOptions.btn2|String|Button 2|button two text. Button 2 is the one on the right side.| |footerOptions.disableBtn2|Boolean|false|button 2 (right side) can be disabled.| |footerOptions.btn1OnClick|Function|() => {}|action when button 1 is clicked.| |footerOptions.btn2OnClick|Function|() => {}|action when button 2 is clicked.| |footerOptions.btn1Style|Object|{}|style or css of button 1. eg. {fontSize: '14px'}| |footerOptions.btn2Style|Object|{}|style or css of button 2. eg. {fontSize: '14px'}|

noFooter

used to remove footer

  • type: Boolean
  • default: false

noHeader

Used to remove header

  • type: Boolean
  • default: false

wrapperBg

Background color of modal wrapper (backdrop) (default is dark)

  • type: String
  • default: rgba(0, 0, 0, 0.5)

darkMode

Used to switch color mode

  • type: Boolean
  • default: false

lightBg

background color of modal dialog when mode is light

  • type: String
  • default: white

darkBg

background color of modal dialog when mode is dark

  • type: String
  • default: #06090f

fontDark

text color of modal when mode is dark

  • type: String
  • default: white

fontLight

text color of modal when mode is light

  • type: String
  • default: black

modalSize

size of modal dialog

  • type: String
  • value: md | lg | xl | full-w | full-hw | sidebar-l | sidebar-r

API

open(args)

accept modal name as args

close(args)

accept modal name as args

Contribution

Feel free to open an issue or pull request. Open an issue if you want discussing something.

Changelogs

More logs

1.1.6

  • Add more modalSize options -> [sidebar-r, sidebar-l]
  • Add little A11y

1.1.5

  • Add props modalSize with value [md, lg, xl, full-w, full-hw]
  • fix reponsiveness problems
  • fix body overflow not automatically being scrollable

License

MIT © burhanahmeed and Initbase