我跑了
npm install @heroicons/react
Run Code Online (Sandbox Code Playgroud)
我的 package.json 看起来像这样:
"dependencies": {
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^2.0.0",
...
Run Code Online (Sandbox Code Playgroud)
但由于某种原因我无法让它工作!
我仍然收到此错误
请帮我一下。我不明白这里有什么问题?
我一直在尝试使用heroicons并继续面临错误我尝试安装'@heroicons/react@v1',我也尝试从“@heroicons/react/outline”和“@heroicons/react/24/outline”导入,有时它可以在手机上使用,如果我刷新它甚至在手机上也不再可用。我尝试单独使用命令提示符,但也没有多大帮助。它一直说:
服务器错误 错误:您正在尝试从 Heroicons v1 导入@heroicons/react/outline/SearchIcon,但已安装 Heroicons v2。安装@heroicons/react@v1以解决此错误。
生成页面时发生此错误。任何控制台日志都将显示在终端窗口中。源组件\Header.js (35:25) @ Header
import React from 'react'
import Image from 'next/image'
import {
SearchIcon,
PlusCircleIcon,
UserGroupIcon,
HeartIcon,
PaperAirplaneIcon,
MenuIcon
} from "@heroicons/react/outline";
import {HomeIcon} from "@heroicons/react/solid"
function Header() {
return (
<div className='shadow-sm border-b bg-white sticky top-0 z-50'>
<div className='flex justify-between max-w-6xl mx-5 lg:mx-auto'>
{/* Left */}
<div className="relative hidden lg:inline-grid h-24 w-24 cursor-pointer">
<Image src="https://links.papareact.com/ocw"
layout="fill"
objectFit='contain'
/>
</div>
<div className="relative w-10 lg:hidden flex-shrink-0 cursor-pointer">
<Image …Run Code Online (Sandbox Code Playgroud) 在我的 vue 组件中添加此引用后,我立即收到错误消息:
<script setup>
import { ExclamationTriangleIcon, XMarkIcon } from '@heroicons/vue/24/outline'
Run Code Online (Sandbox Code Playgroud)
我使用的是 tailwindcss 3.1.8。
我已经执行了这个:
npm install @headlessui/vue @heroicons/vue
Run Code Online (Sandbox Code Playgroud)
我安装了 Heroicons 1.0.6 版本。为什么找不到图标?