sidebar 相关问题

侧边栏标签用于与向应用程序一侧显示或呈现信息相关的问题。

如何使展开的部分与其他部分达到相同的高度?

我正在尝试制作一个带有扩展项目列表的 html css 页面。我需要扩展部分也与 Figma 设计图像具有相同的垂直位置 身体 { 玛...

回答 1 投票 0

coreui - 如何在侧边栏的页脚 (CSidebarFooter) 正确创建注销链接(带图标)? (在 React 中)折叠/展开问题

在React的coreui中,如何在侧边栏的页脚正确创建注销链接(带图标)? (在 React 中)我希望当侧边栏展开时,它应该有图标和文本。当 b 面时...

回答 1 投票 0

为侧边栏导航进行简单的 Turbostream 更新而苦苦挣扎

涡轮触发链接只是刷新我的用户显示视图的页面。 我尝试了turbo_stream.replace和turbo_stream.update也指向框架rightmaincontent,但发生的只是

回答 1 投票 0

PrimeNG 侧边栏可清除 primeng 消息。为什么?

在我的 app.component.html 中我有 ... 在我的 app.component.html 中我有 <div class="main"> <button type="button" (click)="onShowNotificationSideBar()" label="Show"></button> <p-sidebar [(visible)]="notificationSideBarVisible" position="right" [style]="{width:'50em'}"> <button type="button" pButton pRipple (click)="showSuccess()" label="S" class="p-button-success"></button> <button type="button" pButton pRipple (click)="showWarn()" label="W" class="p-button-warning"></button> <button type="button" pButton pRipple (click)="showError()" label="E" class="p-button-danger"></button> <h3>Messages</h3> <h5>{{messages}}</h5> <p-messages [(value)]="messages" [enableService]="false" ></p-messages> </p-sidebar> <p-toast position="center"></p-toast> <router-outlet></router-outlet> </div> 在 app.component.ts 中我有 import { Component } from '@angular/core'; import { Message, MessageService } from 'primeng/api'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], providers: [MessageService] }) export class AppComponent { title = 'WECO'; notificationSideBarVisible = false; constructor(private messageService: MessageService) { messageService.messageObserver.subscribe((m:Message | Message[])=>{ if (!Array.isArray(m)){ this.messages.push(m) } this.messages = [...this.messages]; }); } onShowNotificationSideBar(){ this.notificationSideBarVisible=true; } count=0; messages : Message[] = [ // { severity: 'success', summary: 'Success', detail: 'Message Content' }, // { severity: 'info', summary: 'Info', detail: 'Message Content' }, // { severity: 'warn', summary: 'Warning', detail: 'Message Content' }, // { severity: 'error', summary: 'Error', detail: 'Message Content' } ]; longSentence = 'Let’s end all this nonsense about how long sentences = run-on sentences. You can have a six-word run-on sentence (“I went shopping I ate donuts.”), while most of the sentences below are much, much longer than that and are not run-ons';//'And let’s end all this nonsense about how long sentences = run-on sentences. You can have a six-word run-on sentence (“I went shopping I ate donuts.”), while most of the sentences below are much, much longer than that and are not run-ons (except for a few examples like Jose Saramago). But whether the sentence is grammatically correct isn’t nearly as important as whether the sentence is fun or beautiful.' showWarn(){ let detail='User Deleted a Weco Rule'; if (this.count++%5===0) detail = this.longSentence; this.messageService.add({severity:'warn', summary:'User Action', detail: detail}); } showSuccess(){ let detail = 'Weco Rule 123 Saved'; if (this.count++%5===0) detail = this.longSentence; this.messageService.add({severity:'success', summary:'Service Call', detail:detail}); } showError(){ let detail = 'api-call:get-factories returned 404'; if (this.count++%5===0) detail = this.longSentence; this.messageService.add({severity:'error', summary:'Service Call', detail:detail}); } } 如果我打开侧边栏并在其中添加一些消息,它们就会出现,但是当我关闭并重新打开时,它们就会消失。 即使我可以看到 messages 变量仍然有它们。为什么? 附: 如果我添加更多消息,我只会看到新消息。 侧边栏菜单有一个名为 p-messages 的组件,如果您检查该元素,您会发现关闭时 p-sidebar 的内容会被破坏。 当您重新打开侧边栏时,数据保持不变,但消息会被破坏。 我认为 p-messages 组件只会显示数组引用发生变化,这可能是由于组件内部的 *ngFor 带有 trackBy,所以我们需要重置内存中的每个数组元素引用,以便我们欺骗 p-messages 认为列表中有新消息,为此我们可以使用对象解构!我会在侧边栏打开时执行此操作(onShowNotificationSideBar) onShowNotificationSideBar() { this.notificationSideBarVisible = true; this.messages = [...this.messages.map(x => ({...x}))]; // <- creates new references for the array and its contents! } 完整代码 import { Component } from '@angular/core'; import { Message, MessageService } from 'primeng/api'; @Component({ selector: 'sidebar-basic-demo', templateUrl: './sidebar-basic-demo.html', providers: [MessageService], }) export class SidebarBasicDemo { title = 'WECO'; notificationSideBarVisible = false; constructor(private messageService: MessageService) { messageService.messageObserver.subscribe((m: Message | Message[]) => { if (!Array.isArray(m)) { this.messages.push(m); } this.messages = [...this.messages]; }); } onShowNotificationSideBar() { this.notificationSideBarVisible = true; this.messages = [...this.messages.map(x => ({...x}))]; } count = 0; messages: Message[] = [ // { severity: 'success', summary: 'Success', detail: 'Message Content' }, // { severity: 'info', summary: 'Info', detail: 'Message Content' }, // { severity: 'warn', summary: 'Warning', detail: 'Message Content' }, // { severity: 'error', summary: 'Error', detail: 'Message Content' } ]; longSentence = 'Let’s end all this nonsense about how long sentences = run-on sentences. You can have a six-word run-on sentence (“I went shopping I ate donuts.”), while most of the sentences below are much, much longer than that and are not run-ons'; //'And let’s end all this nonsense about how long sentences = run-on sentences. You can have a six-word run-on sentence (“I went shopping I ate donuts.”), while most of the sentences below are much, much longer than that and are not run-ons (except for a few examples like Jose Saramago). But whether the sentence is grammatically correct isn’t nearly as important as whether the sentence is fun or beautiful.' showWarn() { let detail = 'User Deleted a Weco Rule'; if (this.count++ % 5 === 0) detail = this.longSentence; this.messageService.add({ severity: 'warn', summary: 'User Action', detail: detail, }); } showSuccess() { let detail = 'Weco Rule 123 Saved'; if (this.count++ % 5 === 0) detail = this.longSentence; this.messageService.add({ severity: 'success', summary: 'Service Call', detail: detail, }); } showError() { let detail = 'api-call:get-factories returned 404'; if (this.count++ % 5 === 0) detail = this.longSentence; this.messageService.add({ severity: 'error', summary: 'Service Call', detail: detail, }); } } html <div class="main"> <button type="button" (click)="onShowNotificationSideBar()" label="Show"> show sidebar </button> <p-sidebar [(visible)]="notificationSideBarVisible" position="right" [style]="{width:'50em'}" > <button type="button" pButton pRipple (click)="showSuccess()" label="S" class="p-button-success" > success </button> <button type="button" pButton pRipple (click)="showWarn()" label="W" class="p-button-warning" > warn </button> <button type="button" pButton pRipple (click)="showError()" label="E" class="p-button-danger" > error </button> <h3>Messages</h3> <h5>{{messages}}</h5> <p-messages [(value)]="messages" [enableService]="false"></p-messages> </p-sidebar> <p-toast position="center"></p-toast> </div> Stackblitz 演示

回答 1 投票 0

响应式布局中的全高侧边栏

我正在尝试创建一个带有全高侧边栏的响应式布局。在桌面上,侧边栏应浮动在主要内容的左侧,在平板电脑/移动设备上,侧边栏应与主要内容重叠...

回答 2 投票 0

将元素定位到高度的底部:100% div

我想将一个按钮“固定”到高度为 100% 的侧边栏 div 的底部,因为它应该填充页面的整个左侧。 我尝试这样做: .侧边栏{ 高度:10...

回答 3 投票 0

Offcanvas 组件不起作用,内容不显示

希望你一切都好! 我有一个挑战要给你:)。我正在尝试在我的 Angular 项目中实现 Offcanvas 组件,它看起来可以工作,但是当我激活该组件时仅显示阴影

回答 2 投票 0

隐藏和显示右侧边栏[关闭]

所以,我正在尝试创建一个 JavaScript 或查询来隐藏右侧边栏 div。事实证明这比我预期的要困难得多,但我已经很接近了。 我创建了一个隐藏/显示右侧边栏,当

回答 1 投票 0

SwiftUI:从 NagivationLink 打开全屏视图(即隐藏侧栏)

我一直在研究苹果文档,寻找一种从导航链接打开视图的方法,其中侧边栏默认折叠。 我尝试过的所有操作都使侧边栏可见(但可折叠......

回答 1 投票 0

如何根据这个数组注册侧边栏?

我有一个输入主题模组,它返回以下值: 边一:1,边二:1,边三:0 这是一个多复选框输入,“,”之前的每个元素代表一个侧边栏 - 一个复选框...nu...

回答 2 投票 0

GitLab 自定义 wiki 侧边栏不起作用

我“拉取”了我项目的 wiki 存储库。 创建“_sidebar.md”文件。 git添加 git 提交 将更改推送到 GitLab。 在 Google Chrome 的隐身模式下加载了我的项目的 Wiki 页面。 定制

回答 4 投票 0

CSS:侧边栏工具提示斗争

我正在开发一个项目,其中有一个侧边栏,当它折叠时,悬停时会出现一个工具提示。但是,当 .sidebar-item-container 的位置设置为相对且 .sidebar-item-name 的

回答 1 投票 0

Javascript - 鼠标悬停时展开/折叠的侧边栏,在页面之间路由时存储状态

我正在使用 HTML/CSS/JS + jQuery 开发一个多页面 Web 应用程序。我正在尝试构建一个在鼠标悬停/鼠标移开时展开和折叠的侧边栏组件。侧边栏有指向其他页面的链接

回答 1 投票 0

带有折叠按钮的 SwiftUI 侧边栏

我尝试在 macos 应用程序的 NavigationSplitView 内的侧边栏中添加一个“添加”按钮,与 Xcode 窗口中的相同。 在侧边栏视图中使用此代码确实会在...

回答 1 投票 0

Javascript 用于更新链接到仪表板中 TabPanel 的活动侧边栏菜单子项

我正在尝试构建一个闪亮的仪表板,其菜单子项应与选项卡面板相对应。我还需要主页上有一个移动到这些选项卡面板的按钮。这部分工作还不错。

回答 1 投票 0

如何拥有一个同时具有弹出窗口和侧边栏且仅在单击按钮时显示的 Chrome 扩展

我有一个屏幕录制扩展程序,当用户单击开始录制按钮时,chrome 浏览器中会显示一个侧边栏,并带有计时器和停止/暂停按钮,当用户单击停止时

回答 1 投票 0

传单侧边栏-v2显示在地图上方而不是在地图内部

我一直在使用侧边栏-v2来制作我正在做的地图,并且我有一些方法来解决这个问题,但我不明白为什么侧边栏出现在地图上方而不是在地图内部。这是显示它的人的照片 输入图片

回答 1 投票 0

为什么我无法导入“react-pro-sidebar/dist/css/styles.css”?

我想在我的jsx文件中添加css文件“react-pro-sidebar/dist/css/styles.css”。但当我尝试时,出现错误。我已经安装了react-pro-sidebar 和所有必需品...... 那...

回答 1 投票 0

React-Pro-Sidebar ver 1 自定义和调整大小

我正在构建一个需要侧边栏进行导航的 Web 应用程序,但从头开始构建一个应用程序需要花费大量时间,因为我仍然是一名业余 React 开发人员。 有谁知道并可以帮忙吗...

回答 2 投票 0

每当路线更改时,Angular 2 侧边栏就会关闭

我有一个侧边栏,您可以在单击栏中的外部或内部的 X 时关闭该侧边栏。但我需要在更改路线时自动关闭(例如从主页到关于或联系人保持打开状态,但我需要

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.