gpt4 book ai didi

typescript - HeadlessUI/vue : TypeError vue. defineComponent 不是一个函数

转载 作者:行者123 更新时间:2023-12-04 16:24:42 27 4
gpt4 key购买 nike

我尝试安装 @headlessui/vue在我的 nuxt项目。
当我尝试使用它时:

<template>
<Menu>
<MenuItems>
<MenuItem>Item</MenuItem>
</MenuItems>
</Menu>
</template>

<script lang="ts">
import Vue from 'vue'
import { Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue'

export default Vue.extend({
components: { Menu, MenuButton, MenuItems, MenuItem },
data () {
return {
isScrolling: false
}
},
....
编译时出现类型错误
TypeError
vue.defineComponent is not a function

最佳答案

完全相同的问题在这里:https://github.com/tailwindlabs/headlessui/issues/31

This library is created for Vue 3. I am not sure that NuxtJS is using Vue 3, I think they are using Vue 2. Can you verify this?


Yep Nuxt hasn’t released a version on Vue 3 yet but as far as I understand a beta is coming in the near future 👍🏻

关于typescript - HeadlessUI/vue : TypeError vue. defineComponent 不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67539820/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com