-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: automatically enable Vue runtime compiler to support Vue templat…
…es and decorators in stories
- Loading branch information
1 parent
d8f4ca8
commit 2f539ba
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<button @click="handleClick">Click me!</button> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
function handleClick() { | ||
alert('Button clicked!') | ||
} | ||
</script > | ||
|
||
<style scoped> | ||
button { | ||
padding: 10px 20px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Meta, StoryObj } from '@storybook/vue3' | ||
|
||
import SimpleButton from './SimpleButton.vue' | ||
|
||
/** | ||
* Shows how to use a decorator to wrap the story with extra markup. | ||
* https://storybook.js.org/docs/writing-stories/decorators | ||
*/ | ||
const meta = { | ||
title: 'Storybook Feature/Use Decorators', | ||
component: SimpleButton, | ||
tags: ['autodocs'], | ||
decorators: [ | ||
() => ({ template: '<div style="margin: 3em;"><story/></div>' }), | ||
], | ||
} satisfies Meta<typeof SimpleButton> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const UseDecoratorsStory: Story = { | ||
args: {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters