Vue Linkify Directive

1.0.1 · abandoned · verified Sun Apr 19

The `vue-linkify` package provides a simple Vue.js directive (`v-linkified`) designed to automatically convert URLs and email addresses within plain text into clickable HTML `<a>` links. This package is built upon the core `linkifyjs` library. Last updated in December 2016 with version 1.0.1, it is primarily compatible with Vue.js 2.x applications and is considered abandoned. Due to its age, it does not support Vue 3.x and incorporates an older version of `linkifyjs`, lacking features and breaking changes introduced in more recent `linkifyjs` releases. Newer alternatives exist for Vue 3 environments.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import and register the `v-linkified` directive globally in a Vue 2 application, applying it to HTML content with custom options.

import Vue from 'vue';
import linkify from 'vue-linkify';

Vue.directive('linkified', linkify);

new Vue({
  el: '#app',
  data: {
    raw: 'Hello from vuejs.org. My email is user@example.com and phone is +1-555-LINK-ME.'
  },
  template: `
    <div id="app">
      <p>Original text:</p>
      <p>{{ raw }}</p>
      <p>Linkified text:</p>
      <div v-html="raw" v-linkified:options="{ className: 'my-link', target: '_blank' }" />
    </div>
  `
});

view raw JSON →