mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:31:49 +08:00
Fixes based on feedback
This commit is contained in:
parent
0b03e56265
commit
83092c8a29
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
export let label = '';
|
export let label = '';
|
||||||
|
|
||||||
let style = backgroundColor ? `background-color: ${backgroundColor}` : '';
|
$: style = backgroundColor ? `background-color: ${backgroundColor}` : '';
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Text = () =>({
|
export const Text = () =>({
|
||||||
|
//👇 This is the same component as the one used in the default export and it's optional
|
||||||
Component:Button,
|
Component:Button,
|
||||||
props:{
|
props:{
|
||||||
label:'Hello',
|
label:'Hello',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<-- Button.stories.svelte -->
|
<-- Button.stories.svelte -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Meta, Story } from '../src/index.js';
|
import { Meta, Story } from '@storybook/addon-svelte-csf';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import Button from './Button.svelte';
|
import Button from './Button.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
|
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
|
||||||
|
|
||||||
import YourComponent from "./YourComponent.svelte';
|
import YourComponent from './YourComponent.svelte';
|
||||||
|
|
||||||
//👇 Some function to demonstrate the behavior
|
//👇 Some function to demonstrate the behavior
|
||||||
function someFunction(valuePropertyA, valuePropertyB) {
|
function someFunction(valuePropertyA, valuePropertyB) {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Template >
|
<Template >
|
||||||
<MyComponent image={image} />
|
<MyComponent {image} />
|
||||||
</Template>
|
</Template>
|
||||||
|
|
||||||
<Story name="WithAnImage" />
|
<Story name="WithAnImage" />
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
import MyComponent from './MyComponent.svelte';
|
import MyComponent from './MyComponent.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Story name="Basic" template="BasicTemplate">
|
<Story name="Basic">
|
||||||
<MyComponent />
|
<MyComponent />
|
||||||
</Story>
|
</Story>
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const simpleData = { foo: 1, bar: 'baz' };
|
export const simpleData = { foo: 1, bar: 'baz' };
|
||||||
export const complexData = { foo: 1, foobar: { bar: 'baz", baz: someData } };
|
export const complexData = { foo: 1, foobar: { bar: 'baz', baz: someData } };
|
||||||
|
|
||||||
export const SimpleStory = () => ({
|
export const SimpleStory = () => ({
|
||||||
Component: MyComponent,
|
Component: MyComponent,
|
||||||
|
@ -41,7 +41,7 @@ When you are building screens in this way, it is typical that the inputs of a co
|
|||||||
'vue/simple-page-implementation.2.mdx',
|
'vue/simple-page-implementation.2.mdx',
|
||||||
'vue/simple-page-implementation.3.mdx',
|
'vue/simple-page-implementation.3.mdx',
|
||||||
'angular/simple-page-implementation.ts.mdx',
|
'angular/simple-page-implementation.ts.mdx',
|
||||||
'svelte/simple-page-implementation.js'
|
'svelte/simple-page-implementation.js',
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user