Fix Storybook exception when generating prop docs on a prop type of function when we don't have the correct scope.

  • When a function has references to a vue instance, or when we don't have
  • the correct instance scope to generate the result, we instead generate
  • the string representation of the function

Problem:

If we have prop with a proptype of Function, auto generating the prop docs can cause an exception if we don't have the correct scope. We don't seem to instantiate a vue instance so we don't have a this reference the instance.

    filterFn: {
      type: Function,
      required: false,
      default: function(listItem) {
        return listItem[this.filterKey].toLowerCase().includes(this.queryStr.toLowerCase());
      },
    },

Before:

Screen_Shot_2019-06-14_at_12.02.27_AM

After:

Screen_Shot_2019-06-14_at_12.09.26_AM

Edited by -

Merge request reports

Loading