From dedbfa76317a3f43282e22c5ccf66b0b2bf4ba46 Mon Sep 17 00:00:00 2001 From: Steve Dodier-Lazaro Date: Fri, 6 Dec 2024 09:46:09 +0100 Subject: [PATCH] fix: Support components without a scope ID Signed-off-by: Steve Dodier-Lazaro --- src/components/StylelessButton.vue | 10 ++++++++++ src/jsx-runtime.ts | 3 +++ src/stories/VueComponentWithoutStyle.mdx | 11 +++++++++++ 3 files changed, 24 insertions(+) create mode 100644 src/components/StylelessButton.vue create mode 100644 src/stories/VueComponentWithoutStyle.mdx diff --git a/src/components/StylelessButton.vue b/src/components/StylelessButton.vue new file mode 100644 index 0000000..7d9a7ec --- /dev/null +++ b/src/components/StylelessButton.vue @@ -0,0 +1,10 @@ + + + diff --git a/src/jsx-runtime.ts b/src/jsx-runtime.ts index 4f7dd86..fa8b090 100644 --- a/src/jsx-runtime.ts +++ b/src/jsx-runtime.ts @@ -9,6 +9,9 @@ const isLikelyVueComponent = (nodeType: any) => { if (!!nodeType.__name && !!nodeType.__scopeId) { return true } + if (!!nodeType.__name && !!nodeType.__hmrId) { + return true + } if (!!nodeType.name && !!nodeType.setup) { return true } diff --git a/src/stories/VueComponentWithoutStyle.mdx b/src/stories/VueComponentWithoutStyle.mdx new file mode 100644 index 0000000..926dd93 --- /dev/null +++ b/src/stories/VueComponentWithoutStyle.mdx @@ -0,0 +1,11 @@ +import { Meta } from '@storybook/blocks' + +import DemoStylelessButton from '../components/StylelessButton.vue' +import { Fragment } from 'react' +import { Fragment as VueFragment } from 'vue' + + + +# Vue component without style tag + +Click me