来自 primefaces 安装问题的 Reactjs 下拉组件

Reactjs dropdown component from primefaces installation issue

我是 Reactjs 的新手,我想在我的应用程序中使用 this kind of dropdown。提到为:-

npm i @bit/primefaces.primereact.dropdown 。当我这样做时,出现以下错误:-

npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@bit%2fprimefaces.primereact.dropdown - Not found npm ERR! 404 npm ERR! 404 '@bit/primefaces.primereact.dropdown@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

如何安装它并在我的应用程序中使用它?

这是您在 React 应用程序中安装 primereact 的方式:npm install primereact --save 然后像这样导入任何你想要的:

import {Dropdown} from 'primereact/dropdown';

确保安装其依赖项和对等依赖项:react-transition-groupclassnamesprimeicons

看看这个。: https://www.primefaces.org/primereact/#/setup

还有这个:https://www.primefaces.org/primereact/#/dropdown