Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

link-preview-vue

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

link-preview-vue

A Vuejs component to fetch metadata from a URL and preview it

  • 0.1.7
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

A Vuejs component to fetch metadata from a URL and preview it

Inspired by link-preview-generator and link-prevue 🙏

MIT Licence Open Source Love Build Status npm version

Demo

Table of Contents

Install

NPM

npm install link-preview-vue

Yarn

yarn add link-preview-vue

UMD build

<script src="https://unpkg.com/link-preview-vue@0.1.4/dist/vuelinkpreview.umd.js"></script>

Usage

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>

Props

PropertyTypeDefaultDescriptionRequired
urlstringWidth of the card previewtrue
widthstring90%Width of the card previewfalse
maxWidthstring700Max Width of the card previewfalse
marginTopstring18pxMargin top for the cardfalse
marginBottomstring18pxMargin bottom for the cardfalse
marginRightstring18pxMargin right for the cardfalse
marginLeftstring18pxMargin left for the cardfalse
canOpenLinkbooleantrueEnables, to open link when clicked on cardfalse

Events

NameDescription
clickIt emits the preview data

Note: If you want to use click event without opening the url, then pass :canOpenLink="false" in the props

Contribute

Thanks for taking the time to contribute, please check out the src to understand how things work.

Reporting Issues

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.

Submitting pull requests

Pull requests are the greatest contributions, so be sure they are focused in scope and do avoid unrelated commits.

  • Fork it!
  • Clone your fork: git clone https://github.com/<your-username>/link-preview-vue
  • Navigate to the newly cloned directory: cd link-preview-vue
  • Create a new branch for the new feature: git checkout -b my-new-feature
  • Install the tools necessary for development: yarn
  • Make your changes.
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request with full remarks documenting your changes

License

MIT License © Shashank Shekhar

FAQs

Package last updated on 26 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc