我们正在porject 中使用ng-select,我现在正面临着无法禁用ng-select窗口的问题。是否可以使用本机代码禁用它,或者我需要找到一些自定义解决方案?
<ng-select
#changeowner
class="custom-owner"
[placeholder]="leagueOwner.full_name"
[clearSearchOnAdd]="true"
(change)="changeLeagueOwner($event)"
[clearable]="false"
[virtualScroll]="true"
[items]="adminLeagueMembers"
(scrollToEnd)="onAdminLoadScrollEnd()"
bindLabel="full_name">
</ng-select>
Run Code Online (Sandbox Code Playgroud) 我正在尝试制作带有信息的交互式地图。当您单击一个点时,它会调整大小并显示一些联系人。这是因为元素获得了:active和:focus伪类。
有没有办法在第二次单击元素时从元素中删除伪类?实际上,是否可以在再次单击时关闭元素?
.distribution-map {
position: relative;
width: 100%;
padding: 20px;
box-sizing: border-box;
margin: 0 auto;
}
.distribution-map .map-point {
cursor: pointer;
outline: none;
top: 20px;
position: absolute;
width: 40px;
height: 40px;
border-radius: 20px;
}
.distribution-map .map-point:active,
.distribution-map .map-point:focus {
margin: 0;
padding: 0;
filter: opacity: 1;
width: 300px;
height: 220px;
color: #e5e5e5;
z-index: 1;
-webkit-transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out;
transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out;
}Run Code Online (Sandbox Code Playgroud)
<div …Run Code Online (Sandbox Code Playgroud)我正在使用ng-select并在选定的项目上触发执行一些逻辑的回调。我面临的问题是,(add)当我从列表中选择该项目并使用该(change)事件时,该事件不会触发。但是,如果我使用列表中的一项两次,则更改事件不会触发,因为它是一个更改事件。
<ng-select
[clearSearchOnAdd]="true"
(change)="changeLeagueOwner($event)"
(add)="test()" ---> nothing here
[clearable]="false"
[items]="adminLeagueMembers"
bindLabel="display_name">
</ng-select>
Run Code Online (Sandbox Code Playgroud) 我在“feed”模块的应用程序中有一个路由。在提要中,我有两种类型的帖子,我需要打开此帖子并通过直接链接显示完整信息,我如何根据条件打开正确的组件,或者我如何解决这个问题?
const feed_routes: Routes = [
{ path: '', component: ParentComponent,
children: [
{ path: ':slug', component: FirstComponent },
{ path: ':slug', component: SecondComponent },
]
}
];
Run Code Online (Sandbox Code Playgroud)