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

abandoned(useContextMenu): new function #2136

Closed
wants to merge 28 commits into from

Conversation

vaakian
Copy link
Contributor

@vaakian vaakian commented Aug 28, 2022

Description

add contextMenu(s) to the vue app with ease.

Redirected to:

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

@songjianet songjianet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be used as a reference.

@@ -0,0 +1,29 @@
import { defineComponent, h, reactive, ref } from 'vue-demi'
import type { RenderableComponent, UseContextMenuOptions } from '@vueuse/core'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import type is best placed at the bottom of all references.


}

export const UseContextMenu = defineComponent<useContextMenuProps>({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can useContextMenuProps be written directly as UseContextMenuOptions | RenderableComponent.

@@ -0,0 +1,139 @@
import type { MaybeComputedRef } from '@vueuse/shared'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import type is best placed at the bottom of all references.

return {
visible,
position,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove useless newlines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the newline is for separating the state and method since there might be a lot more
property to return.
see core/useManualRefHistory/index.ts#L201

but it's okay to remove it as well, thanks for the suggestions!

import { ref, watch } from 'vue-demi'
import type { MaybeElementRef } from '../unrefElement'
import type { MaybeComputedElementRef } from '../unrefElement'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import type is best placed at the bottom of all references.

@vaakian
Copy link
Contributor Author

vaakian commented Aug 29, 2022

TODO(done): Fix the edge case

If clicking on the edge of the page:

  • case 1: click on the bottom edge, put it on the left of the cursor.
  • case 2: click on the right edge, put it on the top of the cursor.
  • case 3: click on the bottom right corner, put it on the top & left of the cursor.

@vaakian vaakian marked this pull request as draft August 30, 2022 09:28
@vaakian vaakian closed this Aug 31, 2022
@vaakian vaakian mentioned this pull request Aug 31, 2022
9 tasks
@vaakian vaakian changed the title feat(useContextMenu): new function abandoned(useContextMenu): new function Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants