components 相关问题

统一建模语言中的一个组件“代表系统的模块化部分,它封装了其内容,其表现形式可在其环境中替换。组件根据提供的和所需的接口定义其行为”。组件的最佳示例可以在ActionScript-Flash,Flex sdks中找到。你有UI组件,如按钮,标签,DataGrids,可重复使用的图表,可分发等。

如何在react JS中使用map函数?我无法使用映射函数来运行循环来循环组件代码。我怎样才能运行它?

App.js具体代码: {blog.map((v, i) => ( ))} App.js具体代码: <Container> <Row> {blog.map((v, i) => ( <ProductItems key={i} blog={v}/> ))} </Row> </Container> function ProductItems() { return ( <Col lg="3" md="6"> <Card > <Card.Img variant="top" src="placeholder.js/100px180" /> <Card.Body> <Card.Title>Card Title</Card.Title> <Card.Text> Some quick example text to build on the card title and make up the bulk of the card's content. </Card.Text> <Button variant="primary">Go somewhere</Button> </Card.Body> </Card> </Col> ); } blog.jsx代码: export let blog = [ { "blog": [ { "userId": 1, "id": 1, "title": "are or do repels provide blacked out to accept the option criticizes", "body": "because and accepts\naccepts the result of refusal convenient and when which is all\nof our things, but they are the thing that will happen to the architect" }, { "userId": 1, "id": 2, "title": "who is to be", "body": "is of things at the time of life\nthey are nothing to follow let the pain of the blessed rebuke those pains and not run away from the caresses of the pleasure, nor any trouble" }, { "userId": 1, "id": 3, "title": "who is to be", "body": "is of things at the time of life\nthey are nothing to follow let the pain of the blessed rebuke those pains and not run away from the caresses of the pleasure, nor any trouble" }, { "userId": 1, "id": 4, "title": "who is to be", "body": "is of things at the time of life\nthey are nothing to follow let the pain of the blessed rebuke those pains and not run away from the caresses of the pleasure, nor any trouble" }, { "userId": 1, "id": 5, "title": "who is to be", "body": "is of things at the time of life\nthey are nothing to follow let the pain of the blessed rebuke those pains and not run away from the caresses of the pleasure, nor any trouble" }, { "userId": 1, "id": 6, "title": "who is to be", "body": "is of things at the time of life\nthey are nothing to follow let the pain of the blessed rebuke those pains and not run away from the caresses of the pleasure, nor any trouble" } ] } ] {描述:blog.jsx 包含 json 代码和我尝试通过地图函数循环的对象。 App.js 文件包含 ProductItems 组件和函数以及映射函数。} 我尝试重复 ProductItems 代码,因为它有卡代码。并期待这个结果并没有发生。 更正您的对象声明。你添加了一些不必要的东西。 代替: export let blog = [{ "blog": [....] }] 应该是: export let blog = [{ "userId": 1, "id": 1, "title": "...", "body": "...." }]; 为了你的对象 blog[0]?.blog?.map((blog)=>{ return <ProductItems key={blog?.id} blog={blog}/> }) 这会起作用

回答 1 投票 0

如何在java中创建加载栏

我需要使用 java swing 创建一个进度条作为我的独立应用程序的加载屏幕。

回答 1 投票 0

我的 CSS 文件未加载到我的 React 项目中

我是新来反应的。尝试将 CSS 应用于我的组件类,但它不适用于该类。 我的文件夹结构: App.jsx 文件代码: 从“./components/FoodItems&...

回答 1 投票 0

STRAPI RestAPI - 如何将图像上传到组件中的媒体字段? 4.2

我对 Strapi v4 有一个很大的疑问,我知道很多人都在问。但我花了4个小时上网,发现了很多案例,但没有一个解决或者只是

回答 1 投票 0

如何使用 Gitlab CI-Component 进行扩展?

我有这个 GitLab CI 组件: 规格: 输入: 信息: 默认:测试 --- .测试组件: 脚本: - echo "$[[输入.消息]]" 我还有这个管道: 阶段: -...

回答 1 投票 0

如何使用react-router-dom导航到网页中的另一条路线?

我正在学习使用 React,但遇到了一个问题。如果您能帮助我,我将不胜感激。在组件中,我插入了一个链接,并且我希望它在单击时将用户带到

回答 1 投票 0

Angular 17独立使用多个组件(以两个组件为例)

*自学html,我会处理css和js,我会使用bootstrap。 *第一次使用前端框架。 *英语是我的第二语言 角度 CLI:17.3.3 节点:20.11.1 包管理器:npm ...

回答 1 投票 0

如何让每次点击有动画的div时都会发生动画?

我是 Angular 的初学者,我正在尝试开发一个简单而小的应用程序,该应用程序由健身房及其相应的经理系统组成,每个健身房都有一个教练名单。到目前为止,如果我...

回答 1 投票 0

如何为ViewContainerRef加载的Angular组件实现CanDeactivate守卫?

我设计了 Angular 页面,其中包含路由到同一组件(称为 ParentComponent)的按钮。每个按钮都会传递不同的查询参数。 ParentComponent 有一个 ViewContainerRef ...

回答 1 投票 0

为文件夹及其子文件夹中的所有文件动态添加Inno Setup组件

Inno Setup:动态添加文件夹中的所有文件并添加组件标签,因此在安装运行期间,用户可以选择自定义安装并选择要复制的文件。 我想创建一个 Inno

回答 1 投票 0

与@chakra-ui

这里有人熟悉@chakra-ui吗?我从 HORIZON UI 购买了代码,但我不知道如何从中提取每个组件的代码。该代码是用 React JSX 和 Tailwind CSS 编写的。可以...

回答 1 投票 0

第二次点击时显示数据

从“react”导入React; 从“./Button”导入按钮; 从“./Section”导入部分; 从“./Dragendrop”导入{Dragendrop}; 导出 const RightBox ...

回答 1 投票 0

悬停效果问题:尽管文本颜色明亮,但悬停时框内的文本会变暗

以下是 Stack Overflow 格式正确的内容: 悬停效果问题:尽管文本颜色明亮,但悬停时框内的文本会变暗 我正在开发一个 React 组件,其中有一个盒子

回答 1 投票 0

如何防止nextjs上组件卸载/重新挂载

在我的 nextjs 14 应用程序中,我有一个不应卸载/重新安装的聊天组件。问题是,在我的移动屏幕上,我创建了一个展开聊天的按钮和一个关闭聊天的按钮。当我表达...

回答 1 投票 0

我正在尝试使用 Material Ui 添加两个应用栏组件,我如何摆脱分隔两个应用栏的线

我正在尝试在 Material-UI 中添加两个 AppBar 组件,一个在另一个之上。但是,我遇到一个问题,即第一个 AppBar 的末尾、第二个 AppBar 的顶部出现一行。 这是一个

回答 1 投票 0

Qt QML:可重用对象的文件内定义

我有一个相当大的 Qml 组件,因此我想使其成为可重用的组件,但它太小/非通用,因此我想避免创建自己的 .qml 文件。 好像

回答 4 投票 0

Flutter Flame 游戏屏幕上是否可以只渲染一次按钮?

我正在尝试开发一款游戏。我想要在游戏屏幕底部有 6 个六边形按钮。然而,它们每秒渲染数千次。我不想要这个。我希望它们只渲染一次......

回答 1 投票 0

Delphi 有“思维导图”组件吗? (最好是原生VCL)[关闭]

我正在为我正在开发的Delphi项目寻找一个预先编写的组件(带源代码),以生成类似于以下的思维导图/概念图: http://en.wikipedia.org/wiki/Image:

回答 9 投票 0

在我的 Vue.js 应用程序中使用 Vitepress 组件

我不是在构建一个文档网站,我只是想利用 Vitepress 组件来构建我自己的常规 Vue.js 应用程序。 我安装了 Vitepress npm i -D vitepress,导入了变量...

回答 1 投票 0

无法读取未定义的属性(读取“地图”)类型错误:无法读取未定义的属性(读取“地图”)收到此错误

这是显示错误的卡片组件 这是代码显示的错误 尝试使用 api 调用映射数据,但映射出现错误。尝试解决它很长时间,请...

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.