Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

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
@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 ^_^

@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
@jaw52 jaw52 deleted the fix/html-tag-as-component branch June 21, 2023 10:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants