$tagList API

The $tagList API will return the tag usage of articles. With this API, you can get your article tags everywhere you need.

WARNING

Documents are still wrok in progress, the page is a incompelete version.

$tagList

  • Type: Object
  • Parent: usePageData().value

Usage

Use in the page, you just need:

$page.$tagList;

Or in the component, you need to import usePageData:

import { usePageData } from "@vuepress/client";
...
const tagList = usePageData().value.$tagList;

You'll get the results like this:

Result
{
  "test": {
    "count": 1,
    "pages": [
      "/post/hello-world/"
    ]
  },
  "test1": {
    "count": 2,
    "pages": [
      "/post/hello-world/",
      "/post/test/"
    ]
  },
  "vuepress2": {
    "count": 1,
    "pages": [
      "/post/using-tailwindcss-in-vuepress2/"
    ]
  },
  "tailwindcss": {
    "count": 1,
    "pages": [
      "/post/using-tailwindcss-in-vuepress2/"
    ]
  },
  "my-test": {
    "count": 1,
    "pages": [
      "/post/test/"
    ]
  }
}