Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zjxxxxxxxxx committed Sep 22, 2023
1 parent 7fced3c commit 0b43bfb
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .changeset/tender-elephants-guess.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@open-editor/shared': patch
---

add type uilt 'isBol'
add type util 'isBol'
6 changes: 3 additions & 3 deletions packages/client/src/resolve/createVueResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ function parseVueSource(__source: string) {
}

let cacheIsVueSource: boolean | undefined;
function isVueSource(element: HTMLElement) {
function isVueSource(element?: HTMLElement | null) {
if (isBol(cacheIsVueSource)) {
return cacheIsVueSource;
}

while (element) {
if (getElementVueSource(element) != null) {
if (getElementVueSource(element)) {
return (cacheIsVueSource = true);
}
element = element.parentElement!;
element = element.parentElement;
}

return (cacheIsVueSource = false);
Expand Down
32 changes: 19 additions & 13 deletions packages/rollup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,25 @@ export default defineConfig({
});
```

## Configuration

The following show the default values of the configuration
## Options

```ts
OpenEditor({
// source root path
rootDir: process.cwd(),

// render the toggle into the browser
displayToggle: false,

// custom openEditor handler
onOpenEditor: undefined,
});
interface Options {
/**
* source rootDir path
*
* @default process.cwd()
*/
rootDir?: string;
/**
* render the toggle into the browser
*
* @default false
*/
displayToggle?: boolean;
/**
* custom openEditor handler
*/
onOpenEditor?(file: string): void;
}
```
32 changes: 19 additions & 13 deletions packages/vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,25 @@ export default defineConfig({
});
```

## Configuration

The following show the default values of the configuration
## Options

```ts
OpenEditor({
// source root path
rootDir: process.cwd(),

// render the toggle into the browser
displayToggle: false,

// custom openEditor handler
onOpenEditor: undefined,
});
interface Options {
/**
* source rootDir path
*
* @default process.cwd()
*/
rootDir?: string;
/**
* render the toggle into the browser
*
* @default false
*/
displayToggle?: boolean;
/**
* custom openEditor handler
*/
onOpenEditor?(file: string): void;
}
```
32 changes: 19 additions & 13 deletions packages/webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,25 @@ module.exports = {
};
```

## Configuration

The following show the default values of the configuration
## Options

```ts
OpenEditor({
// source root path
rootDir: process.cwd(),

// render the toggle into the browser
displayToggle: false,

// custom openEditor handler
onOpenEditor: undefined,
});
interface Options {
/**
* source rootDir path
*
* @default process.cwd()
*/
rootDir?: string;
/**
* render the toggle into the browser
*
* @default false
*/
displayToggle?: boolean;
/**
* custom openEditor handler
*/
onOpenEditor?(file: string): void;
}
```

0 comments on commit 0b43bfb

Please sign in to comment.