diff --git a/addons/docs/src/frameworks/vue/sourceDecorator.test.ts b/addons/docs/src/frameworks/vue/sourceDecorator.test.ts index 9f21c563720b..b02569d9aa62 100644 --- a/addons/docs/src/frameworks/vue/sourceDecorator.test.ts +++ b/addons/docs/src/frameworks/vue/sourceDecorator.test.ts @@ -32,7 +32,7 @@ describe('vnodeToString', () => { it('attributes', () => { const MyComponent: ComponentOptions = { - props: ['propA', 'propB', 'propC', 'propD'], + props: ['propA', 'propB', 'propC', 'propD', 'propE', 'propF', 'propG'], template: '
', }; @@ -49,6 +49,13 @@ describe('vnodeToString', () => { propD: { foo: 'bar', }, + propE: true, + propF() { + const foo = 'bar'; + + return foo; + }, + propG: undefined, }, }; }, @@ -56,7 +63,7 @@ describe('vnodeToString', () => { }) ) ).toMatchInlineSnapshot( - `` + `` ); }); diff --git a/addons/docs/src/frameworks/vue/sourceDecorator.ts b/addons/docs/src/frameworks/vue/sourceDecorator.ts index 749ed00ab932..04975f10420c 100644 --- a/addons/docs/src/frameworks/vue/sourceDecorator.ts +++ b/addons/docs/src/frameworks/vue/sourceDecorator.ts @@ -123,7 +123,7 @@ export function vnodeToString(vnode: Vue.VNode): string { } function stringifyAttr(attrName: string, value?: any): string | null { - if (typeof value === 'undefined') { + if (typeof value === 'undefined' || typeof value === 'function') { return null; }