如何将 Fomantic

编程入门 行业动态 更新时间:2024-10-26 16:29:25
本文介绍了如何将 Fomantic-UI 导入 Angular 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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"上不存在属性modal".

TS2339:类型JQuery"上不存在属性calendar".

TS2339:JQuery"类型上不存在属性dropdown".

等等...

你知道在我的项目中导入 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:关键词]

本文发布于:2023-04-23 08:38:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1039125.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   Fomantic

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!