Fixes based on feedback

This commit is contained in:
jonniebigodes 2021-05-06 20:04:33 +01:00
parent 0b03e56265
commit 83092c8a29
8 changed files with 8 additions and 7 deletions

View File

@ -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();

View File

@ -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',

View File

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

View File

@ -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) {

View File

@ -20,7 +20,7 @@
/> />
<Template > <Template >
<MyComponent image={image} /> <MyComponent {image} />
</Template> </Template>
<Story name="WithAnImage" /> <Story name="WithAnImage" />

View File

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

View File

@ -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,

View File

@ -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',
]} ]}
/> />