Setting Vue props via a variable in the story file
See original GitHub issueDescribe the bug
Prior to version 6.2.9 the following Story worked:
const org = { name: 'example-org' };
export const Default = () => ({
components: { Projects },
store: getClonedStore(),
props: {
org: { default: org },
},
provide: { user, org, group, requirements },
template: `<Projects :org="org" />`,
});
Now there’s an error saying org is null.
If I change it to this it works again:
const org = { name: 'example-org' };
export const Default = () => ({
components: { Projects },
store: getClonedStore(),
data() {
return {
org,
};
},
provide: { user, org, group, requirements },
template: `<Projects :org="org" />`,
});
There appears to be some form of regression in the latest version. We were previously on 6.1.21.
We plan to move to the new format, but have hundreds of stories that need reworking and want to do this gradually.
Does anyone have any idea how we can fix this?
System
Environment Info:
System:
OS: macOS 11.3
CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
Binaries:
Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.14.11 - ~/Code/snyk/registry/frontend/node_modules/.bin/npm
Browsers:
Chrome: 90.0.4430.93
Firefox: 82.0.2
Safari: 14.1
npmPackages:
@storybook/addon-a11y: ^6.2.9 => 6.2.9
@storybook/addon-actions: ^6.2.9 => 6.2.9
@storybook/addon-backgrounds: ^6.2.9 => 6.2.9
@storybook/addon-docs: ^6.2.9 => 6.2.9
@storybook/addon-queryparams: ^6.2.9 => 6.2.9
@storybook/addon-storysource: ^6.2.9 => 6.2.9
@storybook/preset-typescript: ^3.0.0 => 3.0.0
@storybook/source-loader: ^6.2.9 => 6.2.9
@storybook/vue: ^6.2.9 => 6.2.9
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Passing Props to Route Components | Vue Router
When props is set to true , the route.params will be set as the component props. Named views #. For routes with named...
Read more >Passing Data via Props in Vue.Js - Yahya Gok - Medium
Props are how you pass data from one component to another, as parameters. In Vue, props (or properties), are the way that we...
Read more >In vue.js component, how to use props in css? - Stack Overflow
Show activity on this post. You actually can! You should define the CSS variables in a Computed Property, then call the computed property...
Read more >5 Easy Ways To Pass Info To Vue Components! - YouTube
Vue.js is really easy to pass information to components. There is props, inject/provide, Vuex and more! In this video I discuss the various ......
Read more >How to Use Props in Vue.js - freeCodeCamp
We use props to pass information/data from a parent component to child components. In this article, I will explain everything you need to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@shilman Did
npx sb@next upgrade --prerelease(installedv6.3.0-beta.4) on the repro repo and it works fine!Awesome. thanks so much! 🙏 closing this for now.