(addon-controls) Support destructering object properties into individual controls
**Is your feature request related to a problem? Please describe.** Im often passing objects to my (Vue) components which by default will be added as JSON.stringified text control by `@storybook/addon-controls`. As I feel this is confusing/limited functionality (also because the JSON object isnt pretty printed (ie `JSON.stringify(obj, null, 2)`) I'd like to destructure my object properties into separate controls for each individual object property. I have currently implemented this as follows in this stripped-down User example below <details><summary>User.vue</summary> ```js // User.vue <template> <p>The name of the user is: {{ user.name }}</p> </template> <script> export default { props: { user: { type: Object, required: true } } } </script> ``` </details> <details><summary>User.story.js</summary> ```js import User from '../User.vue' export default { title: 'User', component: User, argTypes: { user_name: { control: 'text', defaultValue: 'pimlie', table: { category: 'user', type: { summary: 'text', } } } } } const Template = (args, { argTypes }) => { console.log(argTypes) return { components: { User }, props: Object.keys(argTypes), watch: { user_name: { immediate: true, handler(value) { // use $set to ensure reactivity in case name // prop doesnt exist on this.user yet this.$set(this.user, 'nam
Posted by pimlie on Aug 17, 2020, 11:38 AM
Tags
Related issues
- The issue is really the extreme difficulty of programming them, especially for anything sequential (rather than combinatorial).
- I probably could have beared with it if it was only limited to programming, but it showing up in creative fields has made me feel all sor...
- I hate that I'm in deep enough to know what you mean.
- The biggest problem with “AI” is that big corps are shoving it down our throats.
- in the middel of a coding session with 5.6 sol.
- [Hero Run] 535B-A23B on 18T tokens
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
reliability (Other)
The issue is really the extreme difficulty of programming them, especially for anything sequential (rather than combinatorial).
I probably could have beared with it if it was only limited to programming, but it showing up in creative fields has made me feel all sor...
I hate that I'm in deep enough to know what you mean.
The biggest problem with “AI” is that big corps are shoving it down our throats.
in the middel of a coding session with 5.6 sol.
[Hero Run] 535B-A23B on 18T tokens
I hate that this is how AI is being used..
inexperienced protobuf user here -- why do non-googlers generally use protobuf?
(addon-controls) Support destructering object properties into individual controls
**Is your feature request related to a problem? Please describe.** Im often passing objects to my (Vue) components which by default will be added as JSON.stringified text control by `@storybook/addon-controls`. As I feel this is confusing/limited functionality (also because the JSON object isnt pretty printed (ie `JSON.stringify(obj, null, 2)`) I'd like to destructure my object properties into separate controls for each individual object property. I have currently implemented this as follows in this stripped-down User example below <details><summary>User.vue</summary> ```js // User.vue <template> <p>The name of the user is: {{ user.name }}</p> </template> <script> export default { props: { user: { type: Object, required: true } } } </script> ``` </details> <details><summary>User.story.js</summary> ```js import User from '../User.vue' export default { title: 'User', component: User, argTypes: { user_name: { control: 'text', defaultValue: 'pimlie', table: { category: 'user', type: { summary: 'text', } } } } } const Template = (args, { argTypes }) => { console.log(argTypes) return { components: { User }, props: Object.keys(argTypes), watch: { user_name: { immediate: true, handler(value) { // use $set to ensure reactivity in case name // prop doesnt exist on this.user yet this.$set(this.user, 'nam
Comments (0)
No comments yet. Start the discussion.