-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f7f0d1
commit 244d9b5
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script setup lang="ts"> | ||
import * as menu from "@zag-js/menu" | ||
import { normalizeProps, useMachine } from "@zag-js/vue" | ||
const [state, send] = useMachine( | ||
menu.machine({ | ||
id: "v1", | ||
onSelect: console.log, | ||
}), | ||
) | ||
const api = computed(() => menu.connect(state.value, send, normalizeProps)) | ||
</script> | ||
|
||
<template> | ||
<main className="context-menu"> | ||
<div v-bind="api.contextTriggerProps">Right Click here</div> | ||
<Teleport to="body"> | ||
<div v-bind="api.positionerProps"> | ||
<ul v-bind="api.contentProps"> | ||
<li v-bind="api.getItemProps({ id: 'edit' })">Edit</li> | ||
<li v-bind="api.getItemProps({ id: 'duplicate' })">Duplicate</li> | ||
<li v-bind="api.getItemProps({ id: 'delete' })">Delete</li> | ||
<li v-bind="api.getItemProps({ id: 'export' })">Export...</li> | ||
</ul> | ||
</div> | ||
</Teleport> | ||
</main> | ||
|
||
<Toolbar> | ||
<StateVisualizer :state="state" /> | ||
</Toolbar> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
244d9b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
zag-nextjs – ./examples/next-ts
zag-nextjs-chakra-ui.vercel.app
zag-two.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app
244d9b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
zag-vue – ./examples/vue-ts
zag-vue-chakra-ui.vercel.app
zag-vue-git-main-chakra-ui.vercel.app
zag-vue.vercel.app
244d9b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
zag-solid – ./examples/solid-ts
zag-solid.vercel.app
zag-solid-chakra-ui.vercel.app
zag-solid-git-main-chakra-ui.vercel.app