如何更改ngx-paginationCSS?我尝试过:
:host /deep/ .ngx-pagination {
padding-left: 0px;
}
:host /deep/.ngx-pagination .current,
.btn-info {
background: #17a2b8 !important;
border: transparent;
border-radius: 20px;
}
:host /deep/.ngx-pagination .current:hover {
background: #17a2b8 !important;
border-radius: 20px;
border: transparent;
}
Run Code Online (Sandbox Code Playgroud)
在组件 .css 内部,但没有任何变化,我收到此警告
[弃用] CSS 动态配置文件中不再支持 /deep/ 组合器。它现在实际上是无操作的,就像一个后代组合器一样。/deep/组合器将被移除,并且在M65处无效。你应该删除它。有关更多详细信息,请参阅https://www.chromestatus.com/features/4964279606312960 。
我该如何解决这个问题?感谢您的时间!
编辑:
.html
<div class="clearfix">
<pagination-controls (pageChange)="p = $event"></pagination-controls>
</div>
Run Code Online (Sandbox Code Playgroud)
.css
.clearfix {
position: relative;
right: 35%;
left: 35%;
font-size: 14px;
}
Run Code Online (Sandbox Code Playgroud)
编辑2:(渲染后的html)
<div class="clearfix">
<pagination-controls nextlabel="Next" previouslabel="Previous" ng-reflect-previous-label="Previous"
ng-reflect-next-label="Next">
<pagination-template ng-reflect-max-size="7">
<!--bindings={
"ng-reflect-ng-if": "true" …Run Code Online (Sandbox Code Playgroud) 在javascript中比较2个对象的最快方法是什么?
例如我有这两个对象:
a = [{'name': 'john', 'age': 22}, {'name': 'mike', 'age': 23}, {'name': 'anne', 'age': 12}, {'name': 'dan', 'age': 29}, {'name': 'jane', 'age': 34}]
b = [{'name': 'john', 'age': 22}, {'name': 'anne', 'age': 12}]
Run Code Online (Sandbox Code Playgroud)
通常,我会这样做:
for (var i = 0; i < a.length; i++) {
for (var j = 0; j < b.length; j++) {
console.log(a[i]) // => [{'name': 'john', 'age': 22}, {'name': 'anne', 'age': 12}]
}
}
Run Code Online (Sandbox Code Playgroud)
这花费的时间太长了,还有其他更快的方法吗?感谢您的时间!
我有一个看起来像这样的对象:
obj = {'a': [0, 0, 1, 0], 'b': [1, 0, 0, 1], 'c': [0, 0, 0, 0], 'd': [1, 1, 1, 0]}
Run Code Online (Sandbox Code Playgroud)
我想在这样的表中显示它:
No | a | b | c | d
0 | 0 | 1 | 0 | 1
1-3 | 0 | 0 | 0 | 1
4-6 | 1 | 0 | 0 | 1
7-9 | 0 | 1 | 0 | 0
//a //b //c //d
Run Code Online (Sandbox Code Playgroud)
我该如何使用ngFor?
这是我的html
<table>
<thead>
<tr> …Run Code Online (Sandbox Code Playgroud) 我有2类过滤器:group和name。我如何修改此代码,因为它们不能作为管道工作,它们是独立的,并且name过滤器覆盖group过滤器并向后覆盖。
.ts
changeGroup(event) {
const group = event.target.value;
const index = this.groupValue.indexOf(group);
if (index > -1) {
this.groupValue.splice(index, 1);
} else {
this.groupValue.push(group);
}
this.transform(this.usersList, 'group', this.groupValue)
if (this.groupValue.length == 0) {
this.transform(this.usersList, '', this.groupValue)
}
}
changeUser(event) {
const user = event.target.value;
const index = this.userValue.indexOf(user);
if (index > -1) {
this.userValue.splice(index, 1);
} else {
this.userValue.push(user);
}
this.transform(this.usersList, 'name', this.userValue)
if (this.userValue.length == 0) {
this.transform(this.usersList, '', this.userValue)
}
} …Run Code Online (Sandbox Code Playgroud) 我有这个功能:
windowInfo_(marker, i, data) {
'<div style="' + this.content_ + '">' +
'<div>' +
'<img [src]="' + "'" + this.image + "'" + '"' + ' style="' + this.image_ + '" alt="avatar">' +
'</div>' +
'<div style="' + this.details_ + '">' +
'<div>' +
'<h5 style="' + this.company_name + '">' + data.company_name + '</h5>' +
'<i class="fa fa-map-marker" id="' + this.country_city + '">' + data.country + ',' + data.city + '</i>' +
'</div>' +
'</div>' +
'</div>' +
'<button class="' …Run Code Online (Sandbox Code Playgroud)