From 0a8a5916aabc8360393f47d335d0b9fd6c22a41a Mon Sep 17 00:00:00 2001 From: GJSSSS Date: Sat, 10 Feb 2024 04:34:18 +0800 Subject: [PATCH] docs: add prepend option docs for `addComponentsDir` (#25683) --- docs/3.api/5.kit/5.components.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/3.api/5.kit/5.components.md b/docs/3.api/5.kit/5.components.md index 64c7adcab3..1e5848b4c8 100644 --- a/docs/3.api/5.kit/5.components.md +++ b/docs/3.api/5.kit/5.components.md @@ -17,7 +17,7 @@ Register a directory to be scanned for components and imported only when used. K ### Type ```ts -async function addComponentsDir (dir: ComponentsDir): void +async function addComponentsDir (dir: ComponentsDir, opts: { prepend?: boolean } = {}): void interface ComponentsDir { path: string @@ -158,6 +158,16 @@ An object with the following properties: Transpile specified path using build.transpile. If set to `'auto'`, it will set `transpile: true` if `node_modules/` is in path. +#### `opts` + +**Required**: `false` + +- `prepend` (optional) + + **Type**: `boolean` + + If set to `true`, the directory will be prepended to the array with `unshift()` instead of `push()`. + ## `addComponent` Register a component to be automatically imported.