{"name":"vue-popup","version":"0.2.0","description":"A popup mixin for vue.js","private":false,"keywords":[],"main":"lib/index.js","scripts":{"dev":"cooking watch","dist":"cooking build -p","prepublish":"cooking build --no-color","deploy":"cooking build --no-color","page":"cooking build -c cooking.example.conf.js -p && gh-pages -d example/dist --remote origin"},"repository":{"type":"git","url":"git+git@github.com:ElemeFE/vue-popup.git/vue-popup.git"},"homepage":"http://git@github.com:ElemeFE/vue-popup.git/vue-popup#readme","author":{"name":"baiyaaaaa"},"license":"MIT","dependencies":{},"devDependencies":{"gh-pages":"^0.11.0","my-local-ip":"^1.0.0"},"gitHead":"7e9cff32c8d2a11c1ad097b1a8e76fad9f1a1df0","_id":"vue-popup@0.2.0","_shasum":"fc8482c750c9f1403df02259f11010783d4ad3d1","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.5.0","_npmUser":{"name":"yi.yang","email":"leopoldthecuber@gmail.com"},"dist":{"shasum":"fc8482c750c9f1403df02259f11010783d4ad3d1","tarball":"http://registry-npm.ywwl.com/vue-popup/download/vue-popup-0.2.0.tgz","integrity":"sha512-HnQ/jqKtOqukCi+eJgGbaVhoAmBtbU9jbmcWf8pg8WPDRRjQUVjBoubrMXZBo6J2jUh9JmMoQrHU8gEvtuT9Ig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDP430FdU3wNUlJ3u4DbX8DE9WoCDvwV7eHcyOlW/zHUAiEA4ezWf81QA76Q5/HyOfqhaBPMYNJqTT7Eby+gRWzRJ2U="}],"size":13064,"noattachment":false,"key":"/vue-popup/-/vue-popup-0.2.0.tgz"},"maintainers":[{"name":"long.zhang","email":"long.zhang@me.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vue-popup-0.2.0.tgz_1470634516740_0.6344626580830663"},"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":1470634516986,"_cnpm_publish_time":1470634516986,"dist-tags":{"latest":"0.2.14"}}