Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add prepend option docs for addComponentsDir #25683

Merged
merged 1 commit into from Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/3.api/5.kit/5.components.md
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down