Skip to content

[3.0.0b1] Multiline default breaks table

Summary

If a prop has a default that spans multiple lines it breaks the table rendering

Steps to reproduce

<template>
    <div>

    </div>
</template>

<script lang='ts'>
    import mixins         from 'vue-typed-mixins'
    import {PropOptions}  from 'vue'

    const Vue = mixins()
    export default Vue.extend({
        name: "TestComponent",
        props: {
            testProp: {
                type: Object,
                default: () => ({
                    a: 1,
                    b: 2,
                })
            } as PropOptions<Record<string, any>>,
            testProp2: String,
        }
    })
</script>

What is the current bug behavior?

## Props

| Name         | Type     | Description | Default                                                                  |
| ------------ | -------- | ----------- | ------------------------------------------------------------------------ |
| `test-prop`  | `Object` |             | `() => ({
                 a: 1,
                 b: 2,
             })` |
| `test-prop2` | `String` |             | &nbsp;                                                                   |

Note: Not sure if feasible, but in general it would be nice if the parser could detect simple default closures that instantiate a default object or array and resolve () => (<X>) / () => <X> to simply <X>