vue-autolink
Auto-link url and images in Vue components
Last updated 5 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-autolink 
SYNC missed versions from official npm registry.

vue-autolink

It's not just link, it's everything link-able in text.

Installation

npm i -D vue-autolink

Example

app.js

// locally
import autoLink from 'vue-autolink/autolink'
new Vue({
  components: { autoLink }
})
// globally
import autoLink from 'vue-autolink'
Vue.use(autoLink)

template

<!-- enable all embed and escape html -->
<auto-link :content="content_variable" embed safe></auto-link>
<!-- enable specific embed-able links -->
<auto-link :content="content_variable" embed="youtube,youku"></auto-link>
<!-- custom attributes -->
<auto-link :content="content_variable" :link-attr="{'data-link': true}" :image-attr="{'data-image': true}"></auto-link>
<!-- it's sure that you can still use :style :class on component -->
<auto-link :class="{myStyle: true}" :style="{textAlign: 'center'}"></auto-link>

For more usages, check out autolink.js

License

MIT © EGOIST

Current Tags

  • 0.0.11                                ...           latest (5 years ago)

2 Versions

  • 0.0.11                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |