Task list

Mr.Hope ... 2021-4-25 Less than 1 minute

Let the Markdown file in your VuePress site support task list.

# Config







 





module.exports = {
  plugins: [
    [
      "md-enhance",
      {
        // Enable Task List
        tasklist: true,
      },
    ],
  ],
};
1
2
3
4
5
6
7
8
9
10
11

# Syntax

  • Use - [ ] some text to render a unchecked task item.
  • Use - [x] some text to render a checked task item. (Capital X is also supported)

# Demo

- [ ] Plan A
- [x] Plan B
1
2

# Advanced

Besides setting tasklist: true in the plugin options, you can also pass objects to it as options. The available options are as follows:

interface TaskListOptions {
  /**
   * Whether disable checkbox
   *
   * @default true
   */
  disabled?: boolean;

  /**
   * Whether use `<label>` to wrap text
   *
   * @default true
   */
  label?: boolean;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last update: June 4, 2022 13:16
Contributors: Mr.Hope , Mr.Hope