Skip to content

[vue-component-meta] defineModel does not have default value #5208

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

Closed
JoJk0 opened this issue Feb 24, 2025 · 0 comments · Fixed by #5209
Closed

[vue-component-meta] defineModel does not have default value #5208

JoJk0 opened this issue Feb 24, 2025 · 0 comments · Fixed by #5209
Labels
good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🍰 p2-nice-to-have

Comments

@JoJk0
Copy link

JoJk0 commented Feb 24, 2025

Vue - Official extension or vue-tsc version

2.2

VSCode version

latest

Vue version

3.5.13

TypeScript version

5.7.3

System Info

package.json dependencies

Steps to reproduce

Create a .vue SFC file and add defineModel clause with default value set

<script lang="ts" setup>
// ...

/**
 * Should the modal be open?
 */
const isOpen = defineModel<boolean>('isOpen', { default: false })
</script>

Run the component through the basic checker and observe lack of default value in returned object.

What is expected?

{
    "default": false,
    "name": "isOpen",
    "global": false,
    "description": "Should the modal be open?", 
    "tags": [],
    "required": false,
    "type": "boolean",
    "declarations": [],
    "schema": {
        "kind": "enum",
        "type": "boolean",
        "schema": [
            "false",
            "true"
        ]
    }
}

What is actually happening?

{
    "name": "isOpen",
    "global": false,
    "description": "", // Also no description - see https://github.com/vuejs/language-tools/issues/4592
    "tags": [],
    "required": false,
    "type": "boolean",
    "declarations": [],
    "schema": {
        "kind": "enum",
        "type": "boolean",
        "schema": [
            "false",
            "true"
        ]
    }
}

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX KazariEX added good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🍰 p2-nice-to-have and removed pending triage labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🍰 p2-nice-to-have
Projects
None yet
2 participants