- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试直接从 ng bootstrap 站点呈现以下 Accordion 菜单:
<div class="container-fluid">
<div class="col-sm-12">
<h1 class="text-center">
Discounts
</h1>
<div class="row">
<ngb-accordion #acc="ngbAccordion">
<ngb-panel id="toggle-1" title="First panel">
<ng-template ngbPanelContent>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
labore sustainable VHS.
</ng-template>
</ngb-panel>
<ngb-panel id="toggle-2" title="Second">
<ng-template ngbPanelContent>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
labore sustainable VHS.
</ng-template>
</ngb-panel>
</ngb-accordion>
</div>
.
.
.
我们有 angular 7,ng-bootstrap 4+,据我所知,一切都应该有效。我们现在不知所措。这是我的应用程序模块:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NavMenuTopComponent } from './views/common/nav-menu-top/nav-menu-top.component';
import { LoginComponent } from './views/common/login.component';
import { Ng2SmartTableModule } from 'ng2-smart-table';
import { AdministrationAnnouncementsComponent } from './views/administration/announcements/administrationAnnouncements.component';
import { AdministrationAppointmentsComponent } from './views/administration/appointments/administrationAppointments.component';
//import { AdministrationAppointmentsComponent } from './views/administration/appointments/administrationAppointments_2.component';
import { AdministrationArchivesComponent } from './views/administration/archives/administrationArchives.component';
import { AdministrationCallsComponent } from './views/administration/calls/administrationCalls.component';
import { AdministrationCompaniesComponent } from './views/administration/companies/administrationCompanies.component';
import { AdministrationCustomersComponent } from './views/administration/customers/administrationCustomers.component';
import { AdministrationEmployeesComponent } from './views/administration/employees/administrationEmployees.component';
import { AdministrationInvoicesComponent } from './views/administration/invoices/administrationInvoices.component';
import { AdministrationObservationsComponent } from './views/administration/observations/administrationObservations.component';
import { AdministrationProblemsComponent } from './views/administration/problems/administrationProblems.component';
import { AdministrationQuickInvoicesComponent } from './views/administration/quickInvoices/administrationQuickInvoices.component';
//import { TechnicianAppointmentsComponent } from './views/technician/appointments/technicianAppointments.component';
//import { TechnicianDiscountsComponent } from './views/technician/discounts/technicianDiscounts.component';
//import { TechnicianHomeComponent } from './views/technician/home/technicianHome.component';
//import { TechnicianInvoicesComponent } from './views/technician/invoices/technicianInvoices.component';
//import { TechnicianOptionsComponent } from './views/technician/options/technicianOptions.component';
//import { TechnicianProblemsComponent } from './views/technician/problems/technicianProblems.component';
//import { TechnicianReviewsComponent } from './views/technician/reviews/technicianReviews.component';
//import { TechnicianSolutionsComponent } from './views/technician/solutions/technicianSolutions.component';
import { jqxGridComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxgrid';
import { JwtModule } from '@auth0/angular-jwt';
import { AdminAuthGuard } from './guards/admin-auth-guard.service';
import { TechAuthGuard } from './guards/tech-auth-guard.service';
import { companyList } from './views/administration/partials/companyList/companyList.component';
import { employeeForm } from './views/administration/partials/employeeForm/employeeForm.component';
import { ButtonRenderComponent } from './views/administration/partials/button-render/button.render.component';
import { employeeSelectForm } from './views/administration/partials/employeeSelectForm/employeeSelectForm.component';
import { customerForm } from './views/administration/partials/customerForm/customerForm.component';
import { cityStateZipSelector } from './views/administration/partials/cityStateZipSelector/cityStateZip.component';
import { customerCreateModal } from './views/administration/partials/customerCreationModal/customerCreationModal.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { createCustomerForm } from './views/administration/partials/createCustomerForm/createCustomerForm.component';
import { customerUpdateForm } from './views/administration/partials/customerUpdateForm/customerUpdateForm.component';
import { employeeCreateForm } from './views/administration/partials/employeeCreateForm/employeeCreateForm.component';
import { CounterComponent } from './views/common/counter/counter.component';
import { jqxSchedulerComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxscheduler';
import { TaskManagementComponent } from './views/administration/taskManagement/taskManagement.component';
import { TaskManagementHomeComponent } from './views/administration/taskManagement/taskManagementHome/taskManagementHome.component';
import { ToastrModule } from 'ngx-toastr';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TaskManagementCategoriesComponent } from './views/administration/taskManagement/taskManagementCategories/taskManagementCategories.component';
import { DemoTechComponent } from './views/technician/demoHome/demoHome.component';
import { AppointmentMaintenance } from './views/technician/appointmentMaintenance/appointmentMaintenance.component';
import { getCompanySalesTax } from './views/administration/partials/getCompanySalesTax/getCompanySalesTax.component';
import { getEmployeeList } from './views/administration/partials/employeeList/employeeList.component';
import { getObservationsList } from './views/administration/partials/ObservationsList/observationsList.component';
import { getCategorySubcategoryList } from './views/administration/partials/CategorySubcategoryList/categorySubcategory.component';
import { ObservationsComponent } from './views/technician/observations/observations.component';
import { FindingsComponent } from './views/technician/findings/findings.component';
import { TechOptionsComponent } from './views/technician/tech-options/tech-options.component';
import { CustomerReviewComponent } from './views/technician/customer-review/customer-review.component';
import { DiscountsComponent } from './views/technician/discounts/discounts.component';
import { MaterialNotesComponent } from './views/technician/material-notes/material-notes.component';
import { TechHomeComponent } from './views/technician/techHome/techHome.component';
import { SalesTaxFormComponent } from './views/administration/partials/salesTaxForm/salesTaxForm.component';
import { environment } from '../environments/environment';
import { AnnouncementsDisplayComponent } from './views/technician/partials/announcements/announcements.component';
import { optionCopyMenuComponent } from './views/technician/partials/optionCopy/optionCopyMenu.component';
import { TechLayoutComponent } from './views/common/techLayout/techLayout.component';
import { AdminLayoutComponent } from './views/common/adminLayout/adminLayout.component';
import { AppointmentDetails } from './views/technician/appointmentDetails/appointmentDetails.component';
import { techHeaderComponent } from './views/technician/partials/techHeader/techHeader.component';
import { DiscountFormComponent } from './views/administration/partials/companyDiscountsForm/discountsForm.component';
import { ServiceChargeFormComponent } from './views/administration/partials/companyServiceChargeForm/serviceChargeForm.component';
import { ObservationListComponent } from './views/technician/partials/observationList/observationList.component';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
export function jwtTokenGetter() {
return sessionStorage.getItem("fleetbooks_JWT");
};
@NgModule({
declarations: [
AppComponent,
NavMenuTopComponent,
LoginComponent,
AdministrationAnnouncementsComponent,
AppointmentDetails,
AdministrationAppointmentsComponent,
AdministrationArchivesComponent,
AdministrationCallsComponent,
AdministrationCompaniesComponent,
AdministrationCustomersComponent,
AdministrationEmployeesComponent,
AdministrationInvoicesComponent,
AdministrationObservationsComponent,
AdministrationProblemsComponent,
AdministrationQuickInvoicesComponent,
//TechnicianAppointmentsComponent,
//TechnicianDiscountsComponent,
//TechnicianHomeComponent,
//TechnicianInvoicesComponent,
//TechnicianOptionsComponent,
//TechnicianProblemsComponent,
//TechnicianReviewsComponent,
//TechnicianSolutionsComponent,
jqxGridComponent,
jqxSchedulerComponent,
companyList,
employeeForm,
employeeSelectForm,
employeeCreateForm,
customerForm,
cityStateZipSelector,
createCustomerForm,
customerUpdateForm,
customerCreateModal,
CounterComponent,
TaskManagementComponent,
TaskManagementHomeComponent,
TaskManagementCategoriesComponent,
DemoTechComponent,
AppointmentMaintenance,
getEmployeeList,
getCompanySalesTax,
getObservationsList,
getCategorySubcategoryList,
ButtonRenderComponent,
ObservationsComponent,
FindingsComponent,
TechOptionsComponent,
CustomerReviewComponent,
DiscountsComponent,
MaterialNotesComponent,
TechHomeComponent,
SalesTaxFormComponent,
AnnouncementsDisplayComponent,
TechLayoutComponent,
AdminLayoutComponent,
optionCopyMenuComponent,
techHeaderComponent,
DiscountFormComponent,
ServiceChargeFormComponent,
ObservationListComponent,
],
entryComponents: [ButtonRenderComponent],
imports: [
Ng2SmartTableModule,
BrowserModule,
HttpClientModule,
JwtModule.forRoot({
config: {
tokenGetter: jwtTokenGetter,
whitelistedDomains: [environment.baseUrl],
blacklistedRoutes: [],
}
}),
NgbModule,
FormsModule,
ReactiveFormsModule,
AppRoutingModule,
BrowserAnimationsModule,
ToastrModule.forRoot({
timeOut: 3000,
positionClass: 'toast-top-right',
}),
FontAwesomeModule
],
providers: [AdminAuthGuard, TechAuthGuard],
bootstrap: [AppComponent]
})
export class AppModule { }
我知道它很长,如果需要我可以把所有没用的东西都去掉。如果需要,我也可以发布我的 package.json。如果我检查元素,我上面链接的代码呈现如下:
<ngb-accordion activeids="ngb-panel-0" class="accordion" role="tablist" ng-reflect-active-ids="ngb-panel-0"><!----></ngb-accordion>
没有控制台错误,没有编译错误,什么都没有。它只是没有出现在页面上,当我去查看检查元素时,我看到的就是这些。
这是我正在寻找引用的教程:https://ng-bootstrap.github.io/#/components/accordion/api
最佳答案
仔细检查您的控制台是否存在可能导致其无法呈现的错误。
关于Angular 7 NGB Accordion 菜单不呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59742424/
我有两个可以相互交换数据的列表。我的列表之一是 Accordion 列表,您可以在其中放置数据,但也包含更多特定的 Accordion ,这些 Accordion 也允许在其中放置数据。我可以在表之间
我正在从数据库中获取记录,我必须在 Accordion 中显示这些记录。我能够显示记录。现在我正在做的是,我必须显示第一个打开的 Accordion ,然后在单击然后关闭上一个打开的 Accordio
我有一个 Accordion ,我希望具有以下功能:当用户单击链接展开时,其他展开的链接(如果有)将折叠。我知道这个功能是内置在 Accordion 插件中的,但我试图避免添加另一个库(jQuery
有点奇怪,这个。我有两个 jquery Accordion 实体,在点击一个 Accordion 中的一个项目时,我想将它动态添加到第二个 Accordion 中,并将其隐藏在原件中。 目前从 A 移
我尝试了以下代码,除了 FontAwesome 图标之外,一切都很好。我尝试在 Google 上寻找解决方案,但找不到我正在寻找的解决方案。 当我单击其中一个 Accordion 时,另一个 Acco
我正在使用 Bootstrap 制作一个响应式网站,它包含带有大量文本的嵌套 Accordion ,当您读到底部并单击下一个 Accordion 时,大量文本被折叠,我留在了页面底部。 我从 Boot
尝试创建嵌套 Accordion 时,是否可以使用 jquery 在另一个 Accordion 内部创建 anchor 链接和 Accordion ? 例如,在我的代码中我有 用于 Accordion
我正在实现一个嵌套 Accordion ,但是当我点击父级 Accordion 中的子组件时,它关闭了父级。我希望它在点击 child 时保持打开状态。 HTML: Home
我试图在 bootstrap Accordion 中添加加号和减号,当显示内容的 div 打开时显示加号,关闭时显示减号,当我打开第二个选项卡时它应该关闭其他打开的选项卡的内容(这个当前正在发生)并且
我有 Angular 5 应用程序,我正在使用 PrimeNG 组件。我创建了带有定义标题的 PrimeNG Accordion ,其中有标题和一些操作按钮,如下所示:
我有一个运行正常的Bootstrap 3.0 Accordion ,当您单击其中一个主链接时,该 Accordion 将打开。唯一的问题是,如果您单击第二个主链接,则第一个链接不会折叠-它们都保持打开
我正在尝试将 Accordion 嵌入另一个 Accordion 中,但是它不起作用,嵌入式 Accordion 只会扩展到第一个扩展 Accordion 的大小,我需要添加额外的空间才能显示内容,任
我正在尝试将 Accordion 放在 Accordion 中。但是第二个 Accordion 不能正常工作。第一个中的 Accordion 根本不起作用。任何帮助将不胜感激 :) 我的问题主要是代码
我正在尝试创建一个交互式 Accordion / Accordion /折叠动画,以便 View 在与交互时折叠/展开自身 - 以相同的方式 flipboard折叠 View ,但两侧都折叠 我认为我
您好,这是我的第一个问题,英语不是我的母语,如果我犯了一些错误,请见谅。 我在我的项目中使用 Angular 6、jQuery 和 BS。 我有两个 Accordion ,每个都有不同的类别。我们将它
我正在构建一个非常简单的 Accordion ,我想设置 ti 在页面加载时打开所有容器。让它打开单个项目(或没有项目)是没有问题的,但我怎样才能让它打开页面加载时的所有项目。 HTML
我正在处理一个刚刚添加了 Accordion 的页面。它有几个不同的 Accordion ,当单击其中任何一个时,所有 Accordion 都会打开。再次单击 Accordion 时,它应该折叠,但它
尝试弄清楚如何在 Dojo 的 Accordion dijit.layout.Accordion 容器上添加展开/折叠箭头图像,就像 dijitTitlePane / dojox.widget.Tit
我有一个 Accordion ,其中包含一些嵌套的 Accordion ,我打算将其用于移动导航。我不是最擅长 JavaScript,所以我必须找到教程才能达到现在的水平。我现在需要的只是当其他 Ac
我基本上试图关闭所有 Accordion ,只打开其中一个被单击的 Accordion 。 因此,短期内只打开一个选项卡。 这是我到目前为止所拥有的: https://jsfiddle.net/gym
我是一名优秀的程序员,十分优秀!