pocka / storybook-addon-vue-info

Info addon for Vue components
https://storybook-addon-vue-info.netlify.com/?path=/story/examples-basic-usage--simple-example
MIT License
164 stars 28 forks source link

Mixins? #99

Closed bichikim closed 5 years ago

bichikim commented 5 years ago

Is your feature request related to a problem? Please describe. My component is

import {Component, Mixins} from 'vue-property-decorator'
import DynamicNavMixin from './DynamicNav.mixin'
@Component
  export default class QDynamicNavItem extends Mixins(DynamicNavMixin) {
}

Does it support Mixins in that way?

Describe the solution you'd like It should show props, data and etc. in the Mixin

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

import DynamicNavMixin from './DynamicNav.mixin'
import {storiesOf} from '@storybook/vue'
import {withInfo} from 'storybook-addon-vue-info'

storiesOf('QDynamicNavItem ', module)
.addDecorator(withInfo)
add(
  'default',
  () => ({...}),
  {
     info: {
        mixins: [DynamicNavMixin ],
     }
  },
)

Additional context Add any other context or screenshots about the feature request here.

pocka commented 5 years ago

@bichikim I think it should work with vue-docgen-api. Have you encountered any problems with that way?

bichikim commented 5 years ago

Hi @pocka Thank you for your time :)

Do you mean working with vue-docgen-api is adding the code below?

// .storybook/webpack.config.js

// This example uses "Full control mode + default".
// If you are using other mode, add payload of `config.module.rules.push` to rules list.
module.exports = ({ config }) => {
  config.module.rules.push({
    test: /\.vue$/,
    loader: 'storybook-addon-vue-info/loader',
    enforce: 'post'
  })

  return config
}

Yes I did

It looks like vue-docgen-api doesn't support the mixin code.

pocka commented 5 years ago

@bichikim I did a quick search on vue-docgen-api then realized it doesn't have enough support for vue-property-decorator.

So, the answer to

Does it support Mixins in that way?

is "No, this addon does not support parsing mixins with vue-property-decorator."

bichikim commented 5 years ago

Thank you for your answer.