Coder Social home page Coder Social logo

vue-ustmodal's Introduction

vue-ustmodal

Version Travis (.org) Downloads/week License npm collaborators

Intro

vue-ustmodal is a modal that can be used in your components without thinking about stylings or modal behaviour.

Getting Started

Installation

  • with NPM

    $ npm install -save vue-ustmodal

  • with Yarn

    $ yarn add vue-ustmodal

Usage

Example

main.js

import Vue from 'vue'
import App from './App.vue'
import ustModal from "vue-ustmodal";

Vue.config.productionTip = false
Vue.use(ustModal);

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

Component.vue

<template>
<div>
    <div class="modal">
        <button @click="modal = true">Open</button>
        
        <ustModal v-model="modal" :styles="styles"> 
            <h3 slot="title">Custom Header</h3>
            <div slot="body">
                <p>This Modal Body</p>
                <p>This Modal Body</p>
                <p>This Modal Body</p>
                <p>This Modal Body</p>
                <p>This Modal Body</p>
            </div>
            <div slot="actions">
                <button @click="modal=false">Cancel</button>
                <button @click="modal=false">OK</button>
            </div>
        </ustModal>
    </div>
</div>
</template>

<script>
import ustModal from './ustModal'
export default {
    components: {
        ustModal
    },
    data: () =>  ({
        modal: true,
        styles: {
            width: "500px"
        }
    })
}
</script>

Contributing

Feel free to contribute to the Open Source NPM Package Template. If you want to contribute.

License

The Open Source NPM Package Template is licensed under the Attribution-NonCommercial-ShareAlike 4.0 International License.

vue-ustmodal's People

Contributors

danushka96 avatar

Watchers

 avatar  avatar

vue-ustmodal's Issues

Hacktoberfest

Need some modal types like

  • Error
  • Success
  • Confirm

Modal types that user can use without worrying about styling the general modal

Usage should be like this

<ustModal v-model="modal" :styles="styles" :type="error"> 
// Modal title, body and actions
</ustModal>
<ustModal v-model="modal" :styles="styles" :type="success"> 
// Modal title, body and actions
</ustModal>
<ustModal v-model="modal" :styles="styles" :type="confirm"> 
// Modal title, body and actions
</ustModal>

Example:

f4af8e0f8393ec42cff77902dabecd2b

(You can use your design. This is just an example )

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.