├── LICENSE ├── .gitignore ├── .babelrc ├── .github └── images │ ├── example-1.png │ └── example-2.png ├── .eslintrc ├── themes └── default.css ├── package.json ├── README.md ├── popover.js └── example.html /LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .vscode/ 3 | npm-debug.log 4 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }], 4 | "stage-0" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.github/images/example-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klummy/VueLinkPopover/HEAD/.github/images/example-1.png -------------------------------------------------------------------------------- /.github/images/example-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klummy/VueLinkPopover/HEAD/.github/images/example-2.png -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard", 3 | "parser": "babel-eslint", 4 | "rules": { 5 | "strict": 0 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /themes/default.css: -------------------------------------------------------------------------------- 1 | .v-popover-enter-active { 2 | transition: all .3s ease-in-out; 3 | } 4 | 5 | .v-popover-leave-active { 6 | transition: all .3s ease-in-out; 7 | } 8 | 9 | .v-popover-enter, 10 | .v-popover-leave-active { 11 | opacity: 0; 12 | transform: translateX(10px); 13 | } 14 | 15 | .v-popover { 16 | /*v-popover container*/ 17 | display: inline-block; 18 | position: relative; 19 | } 20 | 21 | .v-popover__content { 22 | /*Style of hidden v-popover content*/ 23 | background: #fff; 24 | border: 1px solid #eee; 25 | box-shadow: 0 6px 6px rgba(16, 16, 16, 0.04), 0 6px 6px rgba(0, 0, 0, 0.05); 26 | max-width: 70vw; 27 | padding: 10px; 28 | position: absolute; 29 | width: 300px; 30 | z-index: 999; 31 | } 32 | 33 | .v-popover__content:hover { 34 | /*background-color: red;*/ 35 | } 36 | 37 | .v-popover__text { 38 | /*Initially shown text*/ 39 | } 40 | 41 | .v-popover__text:hover { 42 | 43 | } 44 | 45 | .v-popover__close-icon { 46 | cursor: pointer; 47 | display: inline-block; 48 | fill: #000; 49 | fill-opacity: .3; 50 | height: .6rem; 51 | position: absolute; 52 | right: 10px; 53 | stroke-width: 0; 54 | stroke: currentColor; 55 | width: .6em; 56 | } 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-link-popover", 3 | "version": "2.0.2", 4 | "description": "Customisable, flexible, easy to use popover contents for Vue.js similar to that used by Facebook & Twitter", 5 | "main": "popover.js", 6 | "scripts": { 7 | "start": "node_modules/browser-sync/bin/browser-sync.js start -s '.' reload -f '*.html,**/*.css,*.js'", 8 | "build": "", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/klummy/VueLinkpopover.git" 14 | }, 15 | "keywords": [ 16 | "Vue", 17 | "popover", 18 | "vue", 19 | "plugins" 20 | ], 21 | "author": "Yekeen Ajeigbe ", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/klummy/VueLinkpopover/issues" 25 | }, 26 | "homepage": "https://github.com/klummy/VueLinkpopover#readme", 27 | "devDependencies": { 28 | "babel-core": "^6.24.0", 29 | "babel-eslint": "^8.0.2", 30 | "babel-loader": "^7.1.2", 31 | "babel-preset-es2015": "^6.22.0", 32 | "babel-preset-stage-0": "^6.22.0", 33 | "browser-sync": "^2.18.7", 34 | "eslint": "^4.11.0", 35 | "eslint-config-standard": "^10.2.1", 36 | "eslint-loader": "^1.6.1", 37 | "eslint-plugin-promise": "^3.4.0", 38 | "eslint-plugin-standard": "^3.0.1" 39 | }, 40 | "dependencies": {} 41 | } 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VueLinkPopover 2 | Customisable, flexible, easy to use popover contents for Vue.js similar to that used by Facebook & Twitter 3 | 4 | ## [Deprecated] This module has been deprecated 5 | 6 | *Inspired by [this](https://medium.com/@jilsonthomas/reusable-user-link-popover-component-using-vue-js-d37e525a8d27#.mxkgxtwj3)* 7 | 8 | [Demo](https://klummy.github.io/VueLinkPopover/example.html) 9 | 10 | ## Installation 11 | In a Vue.js project, install with ```npm install --save vue-link-popover```. 12 | 13 | For browser based environments, download popover.js or use it from a CDN: 14 | ``` 12 | 13 | 14 | 15 |
16 |
17 |
18 |
19 |

20 | Vue Link Popover 21 |

22 |

23 | Customisable, flexible, easy to use popover contents for Vue.js similar to that used by Facebook & Twitter 24 |

25 |
26 |
27 |
28 | 29 |
30 | 31 |
32 |

Demos

33 | 34 |
35 | 36 | 37 |
38 | By default, the popup is shown when the trigger text/content is hovered upon 39 |
40 |
41 | 42 | 43 | 44 |
45 |

The Man James Bond

46 |

Royal Navy Commander James Bond, CMG, RNVR, is a fictional character created by British journalist and novelist Ian Fleming in 1953. He is the protagonist of the James Bond series of novels, films, comics and video games. Fleming wrote twelve Bond novels and two short story collections, although the last two books—The Man with the Golden Gun and Octopussy and The Living Daylights—were published posthumously.

47 | 48 |
49 |
50 |
51 |
52 | 53 |
54 |
55 |

Installation

56 |

Get up and running with Vue-Link-Popover

57 |
58 | 59 |
60 |

In a Vue.js project, install with npm install --save vue-link-popover.

61 | 62 |

63 | For browser based environments, download popover.js or use it from a CDN: 64 |
65 | <script src="https://unpkg.com/vue-link-popover/popover.js"><script> 66 |

67 | 68 |

69 | Optionally but recommended, include the default stylings by either copying & tweaking the styles in themes/default.css or by including it via CDN - <link rel="stylesheet" href="https://unpkg.com/vue-link-popover/themes/default.css" /> 70 |

71 |
72 |
73 | 74 |
75 |

Usage

76 |
77 |

78 | For browser environments, the plugin is automatically initialized with the default options so it can be used immediately with the <link-popover> tag. 79 |

80 | 81 |

82 | Import it as a component: 83 |

 84 |               
 85 |                 import LinkPopover from 'vue-link-popover'
86 | // Register component 87 | components: { 88 | LinkPopover 89 | } 90 |
91 |
92 | 93 | To use it globally, import it from the package & then register it: 94 |
 95 |               
 96 |                 import Vue from 'vue' 
97 | import 'vue-link-popover/themes/default.css'
98 | import LinkPopover from 'vue-link-popover'
99 | Vue.component('link-popover', LinkPopover) 100 |
101 |
102 | 103 | Importing it globally allows the passing of customisation options such as transitionName & custom themes. For example: Vue.use(LinkPopover, { theme: 'snow-white', transitionName: 'my-awesome-transition'}) 104 |

105 | 106 |

Available Options

107 |
    108 |
  • click By default, the popover shows when hovered upon, however, you can change this behaviour to open the popup only when the click parameter is passed. Unlike the other options, this is used right on the popup container. For example, Opens the popover click.
    Opened on click
  • 109 |
  • transitionName; This is the name of the transition to be used. See the VueJS animation guide for how to use animations in Vue
  • 110 |
  • theme: This is the root class of the popup which you can use to easily customise the popup. For example, passing a theme variable of 'snow-white' can be used like this when styling: 111 |
    112 |
    113 |                 
    114 |                   .snow-white.popover {
    115 |                     // Popup container
    116 | 
    117 |                     &__text {
    118 |                       // Visible text shown in browser
    119 |                     }
    120 | 
    121 |                     &__content {
    122 |                       // Hidden popover content container                    }
    123 |                   }
    124 | 
    125 |                 
    126 |               
    127 |
  • 128 | 129 |
130 | 131 | 132 |
133 |
134 |
135 |
136 | 137 | 151 | 152 | 153 | --------------------------------------------------------------------------------