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

Missing "./types" specifier in "vue" package, how to use withDefaults in Vue2.7.15 with ts setup #13138

Closed
52javascript opened this issue Dec 23, 2023 · 1 comment

Comments

@52javascript
Copy link

Version

2.7.15

Reproduction link

codepen.io/wuxx/pen/GReRwwy

Steps to reproduce

import { withDefaults } from 'vue/types'

interface Props {
layout: string
}

const props = withDefaults(defineProps(), {
layout: 'total, prev, pager, next, sizes, jumper'
})

What is expected?

i want to set props default value

What is actually happening?

8:34:23 PM [vite] Internal server error: Missing "./types" specifier in "vue" package
Plugin: vite:import-analysis

@yyx990803
Copy link
Member

withDefaults is a macro. There is no need to import it.

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

No branches or pull requests

2 participants