{"name":"vue-popup","version":"0.0.2","description":"A popup mixin for vue.","main":"lib/index.js","scripts":{"test":"test","prepublish":"cp src/*.css lib & node_modules/babel-cli/bin/babel.js src --out-dir lib"},"babel":{"presets":["es2015"]},"keywords":["popup","vue"],"author":{"name":"long.zhang@ele.me"},"license":"MIT","peerDependencies":{"vue":"^1.0.10","wind-dom":"0.0.3"},"devDependencies":{"babel-cli":"^6.3.15","babel-core":"^6.3.15","babel-preset-es2015":"^6.3.13"},"_id":"vue-popup@0.0.2","_shasum":"1364d22a18cd724fbad63090de81b3ed6adae7df","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"long.zhang","email":"long.zhang@me.com"},"dist":{"shasum":"1364d22a18cd724fbad63090de81b3ed6adae7df","tarball":"http://registry-npm.ywwl.com/vue-popup/download/vue-popup-0.0.2.tgz","integrity":"sha512-Lh7mRCk2AMfqbgUbWIoXbeQZn5Jm/YPhg4hdMFRM14MjK4ICebFxJe73ZnkA8HGWaM02k5UKJfXli3BuE7fwtg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOKjAOLCIj+iOO9l3nhOrsargK9tgcJN5cCr7LJ4vnjwIgGbGDtVryHZs7avXbVs/OOUfjnkHFaD88NZMeHYo7FZM="}],"size":5076,"noattachment":false,"key":"/vue-popup/-/vue-popup-0.0.2.tgz"},"maintainers":[{"name":"long.zhang","email":"long.zhang@me.com"}],"directories":{},"readme":"# Overview\nvue-popup is a popup mixin for vue.js\n\n# Installation\nFirst, install `vue-popup` from npm:\n```bash\n$ npm install vue-popup\n```\n\nThen import it:\n```javascript\nimport Popup from 'vue-popup';\nrequire('vue-popup/lib/popup.css');\n```\n\n# Usage\nIn a vue instance, define its `mixins`:\n```javascript\nmixins: [Popup]\n```\nThen `vue-popup`'s APIs(see below) are accessible via the vue instance's `props` attribute.\n\n# Example\nGoal: on your page you have a button. When it's clicked, an alert pops up.\n\nFirst let's deal with the alert component in `alert.vue`:\n```html\n<template>\n  <div v-if=\"rendered\" v-show=\"visible\" class=\"alert\">\n    <p>Alert!</p>\n  </div>\n</template>\n<style>\n  .alert {\n    position: fixed;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%);\n  }\n</style>\n<script>\n  import Popup from 'vue-popup';\n  require('vue-popup/lib/popup.css');\n  export default {\n      mixins: [Popup],\n      props: {\n        modal: {\n          default: true\n        },\n        closeOnClickModal: {\n          default: true\n        }\n      }\n    };\n</script>\n```\nAs you can see, `v-if=\"rendered\"` and `v-show=\"visible\"` should be added on the outermost tag of the component. Its `props` attribute has two keys: `modal` and `closeOnClickModal`, please refer to API below for detailed information.\n\nThat's it for the alert component. Let's move on to the main page:\n```html\n<template>\n  <button @click=\"alertVisible = true\">Open Dialog</button>\n  <alert :visible.sync=\"alertVisible\"></alert>\n</template>\n<script>\n  const Alert = require('./alert.vue');\n  export default {\n    components: { Alert },\n    data() {\n      return {\n        alertVisible: false\n      };\n    }\n  };\n</script>\n```\nNote that the main page's `alertVisible` syncs with the component's `visible`, so when the button is clicked, `alertVisible` becomes `true` thus the alert component pops up.\n\n# API\n| Option             | Description                                                      | Value                  | Default  |\n|--------------------|------------------------------------------------------------------|------------------------|----------|\n| visible            | visibility of the popup element                                  | Boolean                | 'false'  |\n| openDelay          | time before the popup element opens                              | Number, in millisecond |          | \n| closeDelay         | time before the popup element closes                             | Number, in millisecond |          |\n| zIndex             | z-index of the popup element                                     | Number                 |          |\n| modal              | determines if a modal pops with the popup element                | Boolean                | 'false'  |\n| modalClass         | class name of the modal                                          | String                 |          |\n| closeOnPressEscape | determines if the popup element closes when escape is clicked    | Boolean                | 'false'  |\n| closeOnClickModal  | determines if the popup element closes when the modal is clicked | Boolean                | 'false'  |\n","publish_time":1449726261585,"_cnpm_publish_time":1449726261585,"dist-tags":{"latest":"0.2.14"}}