Skip to content

Add composite api - #124

Open
kevinluo201 wants to merge 5 commits into
webfansplz:mainfrom
kevinluo201:add-composite-api
Open

Add composite api#124
kevinluo201 wants to merge 5 commits into
webfansplz:mainfrom
kevinluo201:add-composite-api

Conversation

@kevinluo201

@kevinluo201 kevinluo201 commented Apr 14, 2025

Copy link
Copy Markdown

#122

  1. Clone the Overlay.vue to OverlayOptionAPI.vue and mount it when vue === 2
  2. convert Overlay.vue to Composite API
  3. extract the toggle button to ToggleButton.vue

@kevinluo201

kevinluo201 commented Apr 14, 2025

Copy link
Copy Markdown
Author

I create this PR because it works, but I still have several questions so welcome to discuss 😁

  1. Vue 2.7 has built-in compositeAPI, but I don't know how to recognize Vue version on runtime in load.js. I only mount the composite-api version when vue === 3
  2. There is no this in the setup script, so only the public methods are exposed. (window as any).__VUE_INSPECTOR__ = { enable, disable, openInEditor } It's ok, isn't it?
  3. I don’t know how onUpdated, onEnabled and onDisabled are used...I thought we only need to emit event or make them props?
  4. I think isChildOf is not used and can be deleted, right?

@kevinluo201
kevinluo201 marked this pull request as ready for review April 14, 2025 02:42
@kevinluo201

Copy link
Copy Markdown
Author

I just removed isChildOf

@devtobi

devtobi commented Apr 16, 2025

Copy link
Copy Markdown

Wow great work already! Looking forward to get this merged!

@kevinluo201

Copy link
Copy Markdown
Author

I still don't know how onUpdated, onEnabled and onDisabled are used, but I make them ref so we can change them from the outside:

window.__VUE_INSPECTOR__.onEnabled = () => {
  console.log('Vue Inspector enabled')
}

@devtobi

devtobi commented Nov 19, 2025

Copy link
Copy Markdown

@webfansplz please take a look at this. 😄

@devtobi

devtobi commented Apr 13, 2026

Copy link
Copy Markdown

@webfansplz Could you take a look at this?

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.

2 participants