From 56a6240bf700ac307342ed494d8bfbabe5c822dc Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 19 Apr 2023 17:50:02 +0800 Subject: ✨docs init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.docs/content/2.api/2.composables.md | 88 ------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 docs/.docs/content/2.api/2.composables.md (limited to 'docs/.docs/content/2.api/2.composables.md') diff --git a/docs/.docs/content/2.api/2.composables.md b/docs/.docs/content/2.api/2.composables.md deleted file mode 100644 index 4c0bea2..0000000 --- a/docs/.docs/content/2.api/2.composables.md +++ /dev/null @@ -1,88 +0,0 @@ -# Composables - -Discover the Docus composables to use in your custom Vue components and pages. - -## `useDocus()` - -`useDocus()`{lang=ts} gives access to docus runtime config, all default values and your custom config from `app.config.ts` - -- `config` refers to the merged config of the current page. - -`main`, `header`, `aside`, `footer` and `titleTemplate` can be set from `_dir.yml` and any `page.md` file. - -The configs in `app.config` file will be used as defaults. - -```vue - - - -``` - -- `tree` refers to the current navigation tree that is displayed in the `aside` component. - -```vue - - - -``` - -::source-link ---- -source: "composables/useDocus.ts" ---- -:: - -## `useMenu()` - -`useMenu()` gives access to `$menu` plugin controlling mobile navigation globally. - -```ts -const { - // Is menu visible - visible, - // Close menu function - close, - // Open menu function - open, - // Toggle menu function - toggle -} = useMenu() -``` - -::source-link ---- -source: "composables/useMenu.ts" ---- -:: - -## `useScrollspy()` - -`useScrollspy()` is used in `docs` layout to make the ToC display the currently visible headings. - -```ts -const { - // Headings on the page - visibleHeadings, - // Active headings (for the current page) - activeHeadings, - // Update headings (an array of DOM nodes) - updateHeadings -} = useScrollspy() -``` - -::source-link ---- -source: "composables/useScrollspy.ts" ---- -:: -- cgit v1.2.3-70-g09d2