virtua
virtua copied to clipboard
defineComponent is not defined error in Nuxt
Describe the bug
I cannot get it to work in Nuxt (v3).
I'm getting a "defineComponent is not defined" error for both of these two scenarios:
- Registering the component via plugin:
import { VList } from 'virtua/vue'
export default defineNuxtPlugin({
name: 'virtua',
parallel: false,
async setup() {
nuxtApp.vueApp.component('VList', VList)
},
})
- Simply importing the component and using it:
<script setup lang="ts">
import { VList } from 'virtua/vue'
</script>
<template>
<div>
<VList :data="data" #default="item">
<div>
{{ item.property }}
</div>
</VList>
</div>
</template>
How to use the package with Nuxt?
To Reproduce
See description.
Expected behavior
The component should just work as shown in the example.
Platform:
- OS: MacOS
- Browser: Chrome
- Version of this package: 0.30.2
- Version of framework: vue 3.4.21, nuxt 3.11.2
Additional context
--