virtua icon indicating copy to clipboard operation
virtua copied to clipboard

defineComponent is not defined error in Nuxt

Open toniengelhardt opened this issue 1 year ago • 0 comments

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:

  1. Registering the component via plugin:
import { VList } from 'virtua/vue'

export default defineNuxtPlugin({
  name: 'virtua',
  parallel: false,
  async setup() {
    nuxtApp.vueApp.component('VList', VList)
  },
})
  1. 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

--

toniengelhardt avatar May 02 '24 23:05 toniengelhardt