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

feat(vue3 compiler): use setup instead data (options api can be disabled) #386

Merged
merged 5 commits into from
Nov 4, 2024

Conversation

userquin
Copy link
Member

@userquin userquin commented Oct 30, 2024

Description

Looks like the idMap isn't available in the _ctx, the data() included inside the options.

This PR also fixes Vue 2 cli example: we need to use .default in webpack plugin and also add vue-template-compiler dev dependency: https://stackblitz.com/edit/unplugin-unplugin-icons-pql4wz?file=package.json

NOTE: the reproduction disabling options api (features: { optionsAPI: false },) in the Vite Vue plugin: that's why data not available in the render function.

This PR includes the vscode python icon in the linked reproduction in all vue examples (working in all examples 🤔 ).

/cc @brc-dd

Linked Issues

fix #385

Additional context

Building vue 3 example without and with options api in Vite Vue plugin:

imagen

Copy link

stackblitz bot commented Oct 30, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

src/core/compilers/vue3.ts Outdated Show resolved Hide resolved
Copy link

socket-security bot commented Oct 30, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@iconify-json/vscode-icons@1.2.2 None 0 3.51 MB cyberalien
npm/@iconify/json@2.2.266 None 0 366 MB cyberalien
npm/eslint-plugin-qwik@1.2.10 eval 0 99.7 kB adamdbradley

View full report↗︎

@userquin userquin marked this pull request as draft October 30, 2024 15:48
@userquin userquin marked this pull request as ready for review October 30, 2024 15:59
@userquin userquin requested a review from antfu October 30, 2024 16:36
@userquin userquin changed the title fix(vue3): use setup instead data feat(vue3 compiler): use setup instead data (options api can be disabled) Oct 30, 2024
@antfu antfu merged commit 0e0e3f4 into main Nov 4, 2024
2 checks passed
@antfu antfu deleted the userquin/fix-vue3-compiler branch November 4, 2024 04:57
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.

Error while loading some icons : Property "idMap" was accessed during render but is not defined on instance.
2 participants