vuejs/vue

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

52javascript opened this issue · 1 comments

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

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