Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use of mixins #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

turboteddy
Copy link

@turboteddy turboteddy commented Jan 11, 2019

Based on comment by @Kocal , I experimented a little bit. I have now knowledge of the inner workings of jsDoc, so this is just a "nudge to look in the right direction".

Works with code like this

/**
 * Description 
 * @mixin   someMixin
 * @vue-computed {*}           comp1              DOCUMENT ME!
 * @vue-computed {*}           comp2              DOCUMENT ME!
 */
export default {

  computed: {
    ...mapGetters([
      'comp1',
      'comp2'
    ])
  },

  methods: {

    /**
     * DOCUMENT ME!
     * @param a
     * @param b=null
     * @returns {*}
     */
    foo(a,b=null) {
        //....
    }
  }
};

...and corresponding module that uses this mixin:

/**
 * Description 
* @module components/someModule
 * @mixies   someMixin
 * @vue-computed {*}           comp3              DOCUMENT ME!
 * @vue-computed {*}           comp4              DOCUMENT ME!
 */
export default {
  name: 'someModuleName',
  mixins: [LanguageKeysMixin]
  // ....
};

However, this hack needs to be improved upon, because...

  • Only mixins with componentName ending with "Mixin" work
  • name of mixin cannot be prefixed with "something/"

Also, it would be nice to have the members that have been mixed into module components/someModule to be displayed for that module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant