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

fix: avoid native tag as component #159

Merged
merged 12 commits into from Jun 21, 2023

Conversation

jaw52
Copy link
Contributor

@jaw52 jaw52 commented Jun 13, 2023

Description

<script setup lang="ts">
let p = "not ok";
</script>

<template>
  <p>{{ p }}</p>
</template>

variable p will be misinterpreted as a component (Component names in vue avoid using html tag)

Linked Issues

This closes #133 ,closes #135

Additional context

@xiaoxiangmoe
Copy link
Collaborator

How about

<script setup lang="ts">
import button from './button.vue'
</script>

<template>
  <button>{{ button }}</button>
</template>

@jaw52
Copy link
Contributor Author

jaw52 commented Jun 13, 2023

How about

<script setup lang="ts">
import button from './button.vue'
</script>

<template>
  <button>{{ button }}</button>
</template>

This is the effect of the official scaffolding of vite + vue3
demo: https://stackblitz.com/edit/vitejs-vite-beh2mo?file=src%2FApp.vue

image

And. This is the effect of running after this commit
image

@jaw52
Copy link
Contributor Author

jaw52 commented Jun 13, 2023

Do we need to add more test cases?

@xiaoxiangmoe
Copy link
Collaborator

Yes, we need more test case.

Include

import button from './button.vue'
import Button from './button.vue'

@jaw52 jaw52 requested a review from xiaoxiangmoe June 13, 2023 09:20
pnpm-lock.yaml Outdated Show resolved Hide resolved
@jaw52 jaw52 requested a review from xiaoxiangmoe June 14, 2023 01:18
@jaw52
Copy link
Contributor Author

jaw52 commented Jun 19, 2023

Is there any work to be done about this PR @xiaoxiangmoe

@jaw52 jaw52 requested a review from xiaoxiangmoe June 19, 2023 06:13
@jaw52
Copy link
Contributor Author

jaw52 commented Jun 19, 2023

@xiaoxiangmoe I'm ready to review, bro ^_^

playground/src/Foo.vue Outdated Show resolved Hide resolved
playground/src/App.vue Outdated Show resolved Hide resolved
src/types.ts Outdated Show resolved Hide resolved
@jaw52 jaw52 requested a review from xiaoxiangmoe June 21, 2023 01:39
@jaw52 jaw52 requested a review from xiaoxiangmoe June 21, 2023 06:58
@jaw52 jaw52 requested a review from xiaoxiangmoe June 21, 2023 09:38
@jaw52 jaw52 changed the title fix: avoid HTML elements as component fix: avoid native tag as component Jun 21, 2023
@xiaoxiangmoe xiaoxiangmoe merged commit d29eeab into unplugin:main Jun 21, 2023
3 checks passed
@jaw52 jaw52 deleted the fix/html-tag-as-component branch June 21, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants