Skip to content

Commit

Permalink
docs: add export expose
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed May 23, 2023
1 parent cfa1fc4 commit c9818a9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/.vitepress/locales/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export const sidebar = (lang: string): DefaultTheme.SidebarItem[] => {
text: 'namedTemplate',
link: `${urlPrefix}/features/named-template`,
},
{
text: 'exportExpose',
link: `${urlPrefix}/features/export-expose`,
},
{
text: 'exportProps',
link: `${urlPrefix}/features/export-props`,
Expand Down
37 changes: 37 additions & 0 deletions docs/features/export-expose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# exportExpose

<StabilityLevel level="experimental" />

Using export syntax to expose.

| Features | Supported |
| :----------: | :----------------: |
| Vue 3 | :white_check_mark: |
| Nuxt 3 | ? |
| Vue 2 | ? |
| Volar Plugin | :white_check_mark: |

## Usage

```vue
<script setup>
export function foo() {}
export const bar = {}
</script>
```

::: details Compiled Code

```vue
<script setup>
function foo() {}
const bar = {}
defineExpose({
foo,
bar,
})
</script>
```

:::
37 changes: 37 additions & 0 deletions docs/zh-CN/features/export-expose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# exportExpose

<StabilityLevel level="experimental" />

Using export syntax to expose.

| Features | Supported |
| :----------: | :----------------: |
| Vue 3 | :white_check_mark: |
| Nuxt 3 | ? |
| Vue 2 | ? |
| Volar Plugin | :white_check_mark: |

## Usage

```vue
<script setup>
export function foo() {}
export const bar = {}
</script>
```

::: details Compiled Code

```vue
<script setup>
function foo() {}
const bar = {}
defineExpose({
foo,
bar,
})
</script>
```

:::

0 comments on commit c9818a9

Please sign in to comment.