Skip to content

This Vue2 plugin allows you to automatically generate a table of contents and insert it into your webpage.

License

Notifications You must be signed in to change notification settings

rovahub/vue-easy-toc

Repository files navigation

@rovahub/vue-easy-toc

This Vue2 plugin allows you to automatically generate a table of contents and insert it into your webpage.

Install

# Npm
npm install @rovahub/vue-easy-toc --save

# Yarn
yarn add @rovahub/vue-easy-toc

Quickstart

Vue 2

Import the @rovahub/vue-easy-toc in your main JavaScript file in src/ folder.

# src/main.js

// main.js

import Vue from "vue";
import App from "./App.vue";
import VueEasyTocPlugin from "@rovahub/vue-easy-toc";

Vue.config.productionTip = false;

Vue.use(VueEasyTocPlugin);

new Vue({
  render: h => h(App)
}).$mount("#app");

Nuxt JS

Create JS file in /plugins/ folder and add content to the plugin file.

# plugins/vue-easy-toc.js

import Vue from 'vue';
import VueEasyTocPlugin from "@rovahub/vue-easy-toc";

Vue.use(VueEasyTocPlugin);

In your nuxt.config.js file, add the plugin to the plugins array:

# nuxt.config.js

module.exports = {
  // ...
  plugins: [
    { src: "~/plugins/vue-easy-toc.js", mode: "client" }
  ],
  // ...
}

Options

About

This Vue2 plugin allows you to automatically generate a table of contents and insert it into your webpage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published