Skip to content

Commit 50595da

Browse files
committed
fix: Support components without a scope ID
Signed-off-by: Steve Dodier-Lazaro <sidnioulz@gmail.com>
1 parent 737d09e commit 50595da

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/components/StylelessButton.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script setup>
2+
const emit = defineEmits(['click'])
3+
const onClick = () => emit('click')
4+
</script>
5+
6+
<template>
7+
<button type="button" @click="onClick">
8+
<slot />
9+
</button>
10+
</template>

src/jsx-runtime.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const isLikelyVueComponent = (nodeType: any) => {
99
if (!!nodeType.__name && !!nodeType.__scopeId) {
1010
return true
1111
}
12+
if (!!nodeType.__name && !!nodeType.__hmrId) {
13+
return true
14+
}
1215
if (!!nodeType.name && !!nodeType.setup) {
1316
return true
1417
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Meta } from '@storybook/blocks'
2+
3+
import DemoStylelessButton from '../components/StylelessButton.vue'
4+
import { Fragment } from 'react'
5+
import { Fragment as VueFragment } from 'vue'
6+
7+
<Meta title="Vue/Without style tag" />
8+
9+
# Vue component without style tag
10+
11+
<DemoStylelessButton>Click me</DemoStylelessButton>

0 commit comments

Comments
 (0)