{"name":"vue-popup","version":"0.2.7","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":{"wind-dom":"0.0.3"},"devDependencies":{"gh-pages":"^0.11.0","my-local-ip":"^1.0.0"},"gitHead":"1889cf44098373707e64c099fd4ee3642df3b171","_id":"vue-popup@0.2.7","_shasum":"be98de5ce5fb7d5c8f1bb77b31a0999bf113f70d","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"yi.yang","email":"leopoldthecuber@gmail.com"},"dist":{"shasum":"be98de5ce5fb7d5c8f1bb77b31a0999bf113f70d","tarball":"http://registry-npm.ywwl.com/vue-popup/download/vue-popup-0.2.7.tgz","integrity":"sha512-hRk2d1Ydadl6KLuVZWvcqDvvn4un9PfqmLETK8l4Opep+zU9HFBx0zF63/6FS5q6XlQSFymT8yAToOmfTWDuhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmRTSYlwBwYnrQo1gvKr7uqiUk06YLndeKrNBTP4VwmAiAeUMPJ8WivKuBLNjJqQ3Mos0bNdxxnYRw06xyzh18JJw=="}],"size":15109,"noattachment":false,"key":"/vue-popup/-/vue-popup-0.2.7.tgz"},"maintainers":[{"name":"long.zhang","email":"long.zhang@me.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vue-popup-0.2.7.tgz_1476174491903_0.5930727808736265"},"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":1476174492120,"_cnpm_publish_time":1476174492120,"dist-tags":{"latest":"0.2.14"}}