When I toggle "show code" in preview, it show just 'Template.bind({})'
But what I want is the actual component code to be printed.
I expected the following code snippet to print either
<default-button :type="type">This is a Button</default-button>
Or
{
props: Object.keys(argTypes),
components: {DefaultButton},
template: `<default-button :type="type">This is a Button</default-button>`,
}
What am I missing? How do I get the output as expected?
Here is my code
import { Meta, Story, Canvas, ArgsTable, Source } from '@storybook/addon-docs/blocks';
import DefaultButton from './index.vue';
<Meta
title="Atoms/Buttons"
component={DefaultButton}
argTypes={{
type: {
description: `value of type attribute for button element`,
control: {
type: `select`,
options: [`button`, `submit`, `reset`],
},
},
}}
/>
export const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {DefaultButton},
template: `<default-button :type="type">This is a Button</default-button>`,
});
# Default Button
This is default button component
<Canvas>
<Story
name="DefaultButton"
args = {{
type: `button`
}}
>
{ Template.bind({}) }
</Story>
</Canvas>
<ArgsTable story="DefaultButton" />
Before the toggle it looks like this,

After the toggle it looks like this:

I'm also experiencing this issue. And I'm also using Vue (2.6.11). As this issue already has the bug and tracked labels I suppose it's a confirmed bug?
Yep fix is on the way today
ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.13 containing PR #12107 that references this issue. Upgrade today to try it out!
Closing this issue. Please re-open if you think there's still more to do.
I still see this error on mine at 6.0.21 for @storybook/web-components! I am using mdx!
@kbhutiya Do you have a repro repo you can share?
@shilman Since its inside our company's repo i dont have a public repo to share ! But below are the screenshots of the config and how component looks! I am using @storybook/web-components at 6.0.21!
main.js

component's mdx file

component's template file

storybook demo

@shilman Is there anything wrong with what i am doing above? Looks like i followed the same pattern as storybook documentation!