Coder Social home page Coder Social logo

modal-vue's Introduction

modal-vue

A modal dialog component for Vue.js 2.x with large modal option

This is a version of colin/modal-vue modified to allow the usage of Bootstrap Modal's large modal feature.

installation

yarn add github:IanBurry/modal-vue

Or

npm install --save github:IanBurry/modal-vue

Then, within the <script> tag of the component in which you want to use the modal-vue component you need to import it, and register it as a component.

import Modal from 'modal-vue'
export default {
  components: { Modal },
  ...rest of component properties
}

Refer to the vuejs documentation page for full details of using components.

properties

One additional property is defined that can be passed to the modal component as an attribute

  • largeModal (Boolean)

usage

Set the largeModal attribute to true as shown below. The attribute can be bound to data, a computed property, or a method that returns boolean

<modal :showModal="showSourceDialog" :closeAction="closeSourceDialog" largeModal="true">
  <h1 slot="header">Select Source</h1>
  <select slot="body" :value="database.source" @change="changeSource($event.target.value)">
    <option v-for="source in ['', ...refdata.sources]">{{ source }}</option>
  </select>
</modal>

demo

The included demo has been updated to show the large modal feature:

If you want to play around with the demo, then follow these steps to get it running locally:

git clone https://github.com/IanBurry/modal-vue.git
cd modal-vue
npm install
npm run demo

and then go to http://localhost:8000 to access it

modal-vue's People

Contributors

ianburry avatar colinf avatar albinodrought avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.