Skip to content

Commit e27d7cf

Browse files
committed
Update docs
1 parent 816ebcf commit e27d7cf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/en/guide/useage.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,21 @@ export default defineComponent({
215215

216216
This library comes with a menu bar component, which is very similar to the function of the right-click menu and the menu bar. Therefore, it is integrated into the library, and you can also use this component to implement the main menu bar function of desktop programs.
217217

218-
For online examples, please refer to [here](https://imengyu.top/pages/vue3-context-menu-demo/#/MenuBar).
218+
::: my-sandbox {template=vue3-ts}
219+
220+
```ts /src/main.ts
221+
import { createApp } from 'vue'
222+
import App from './App.vue'
223+
import ContextMenu from '@imengyu/vue3-context-menu'
224+
import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css'
225+
226+
createApp(App)
227+
.use(ContextMenu)
228+
.mount('#app')
229+
```
230+
231+
```vue /src/App.vue [active]
219232
220-
```vue
221233
<template>
222234
<MenuBar :options="menuData" />
223235
</template>
@@ -282,3 +294,5 @@ const menuData : MenuBarOptions = {
282294
};
283295
</script>
284296
```
297+
298+
:::

0 commit comments

Comments
 (0)