问题描述
限时送ChatGPT账号..我正在开发一个基于 Fomantic-UI 框架(Semantic-UI 的一个分支)的 Angular 项目.
I'm developing an Angular project base on Fomantic-UI framework (that is a fork of Semantic-UI).
我已经安装了:
npm install --save fomantic-ui
然后我在 angular.json
文件中添加了以下几行:
and then I have added the following lines in angular.json
file:
"styles": [
"node_modules/fomantic-ui/dist/semantic.min.css",
"src/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/fomantic-ui/dist/semantic.min.js"
]
我还使用 npm install --save @types/semantic-ui
为它安装了类型,并且根据 this,它们应该可以与 Fomantic-UI 一起正常工作.
I have also installed types for it with npm install --save @types/semantic-ui
and, according to this, they should work fine with Fomantic-UI.
无论如何这似乎还不足以使用modal()
、dropdown()
、calendar()
等函数,事实上我的 IDE (Webstorm) 和编译期间都出现错误:
Anyway this seems not to be enough to use functions such as modal()
, dropdown()
, calendar()
, in fact I get error both within my IDE (Webstorm) and during compile:
TS2339:类型JQuery
TS2339:类型JQuery"上不存在属性calendar".
TS2339:JQuery
等等...
你知道在我的项目中导入 Fomantic-UI 的正确方法是什么吗?
Do you know what is the right way to import Fomantic-UI in my project?
推荐答案
有几个问题,先安装jquery
There is several issues , first install jquery
安装 jquery
npm install jquery — save
错误 TS2339:属性 'modal' 没有存在于类型 'JQuery'
根据用户 @tucker
JQuery
类型上不存在属性 modal
安装
Property modal
does not exist on type JQuery
install
npm install -D @types/bootstrap
这篇关于如何将 Fomantic-UI 导入 Angular 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论