Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
link-preview-vue
Advanced tools
A Vuejs component to fetch metadata from a URL and preview it
A Vuejs component to fetch metadata from a URL and preview it
Inspired by link-preview-generator and link-prevue 🙏
npm install link-preview-vue
yarn add link-preview-vue
<script src="https://unpkg.com/link-preview-vue@0.1.4/dist/vuelinkpreview.umd.js"></script>
Script
import VueLinkPreview from 'link-preview-vue'
export default {
components:{
VueLinkPreview
},
methods: {
handleClick(prevue) {
console.log('click', prevue.domain, prevue.title, prevue.description, prevue.img)
}
}
}
Template
<div id="app">
<link-prevue url="https://vuejs.org/" @click="handleClick"></link-prevue>
</div>
Property | Type | Default | Description | Required |
---|---|---|---|---|
url | string | Width of the card preview | true | |
width | string | 90% | Width of the card preview | false |
maxWidth | string | 700 | Max Width of the card preview | false |
marginTop | string | 18px | Margin top for the card | false |
marginBottom | string | 18px | Margin bottom for the card | false |
marginRight | string | 18px | Margin right for the card | false |
marginLeft | string | 18px | Margin left for the card | false |
canOpenLink | boolean | true | Enables, to open link when clicked on card | false |
Name | Description |
---|---|
click | It emits the preview data |
Note: If you want to use
click
event without opening the url, then pass:canOpenLink="false"
in the props
Thanks for taking the time to contribute, please check out the src to understand how things work.
Found a problem? Want a new feature? First of all, see if your issue or idea has already been reported. If don't, just open a new clear and descriptive issue.
Pull requests are the greatest contributions, so be sure they are focused in scope and do avoid unrelated commits.
git clone https://github.com/<your-username>/link-preview-vue
cd link-preview-vue
git checkout -b my-new-feature
yarn
git commit -am 'Add some feature'
git push origin my-new-feature
FAQs
A Vuejs component to fetch metadata from a URL and preview it
The npm package link-preview-vue receives a total of 0 weekly downloads. As such, link-preview-vue popularity was classified as not popular.
We found that link-preview-vue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.