有没有办法去除边框,我认为它box-shadow是mat-expansion-panel来自Angular材料?我希望它全白,所以你只会看到文字和扩展箭头
<mat-accordion>
<mat-expansion-panel class="" (opened)="panelOpenState = true"
(closed)="panelOpenState = false">
<mat-expansion-panel-header>
<mat-panel-title>
<span class="right">Filter</span>
</mat-panel-title>
</mat-expansion-panel-header>
<p><app-data></app-data></p>
</mat-expansion-panel>
</mat-accordion>
Run Code Online (Sandbox Code Playgroud)
我正在开发一个显示数据表中实体概述的应用程序。每个实体都有链接的实体,在列中显示为“xxx 个链接的实体”。当用户单击该列的值时,将打开一个显示链接实体列表的材料对话框。这些都是与其他实体的链接。单击这些链接之一后,将显示实体的正确页面,但该对话框不会关闭。使用后退按钮时我确实关闭了。我正在使用该closeOnNavigation物业。
一些示例代码:
在我的主要组件中:
public openDialog(entity: Entity) {
const dialogRef = this.dialog.open(EntityDialogComponent, {
closeOnNavigation: true,
data: {
entity,
otherEntities: this.getNameOfOtherEntities(),
},
});
}
Run Code Online (Sandbox Code Playgroud)
对话框的HTML:
<h1 mat-dialog-title>Linked {{otherEntities}}:</h1>
<mat-dialog-content>
<mat-list role="list">
<mat-list-item role="listitem" *ngFor="let linkedEntity of entity.getProperty('linkedEntities')">
<a class="m-link m--font-bold" [routerLink]="['/reporting/' + otherEntities, linkedEntity.id]">{{linkedEntity.name}}</a>
</mat-list-item>
</mat-list>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-button (click)="cancel()">Close</button>
</mat-dialog-actions>
Run Code Online (Sandbox Code Playgroud)
对话框组件:
@Component({
selector: "entity-dialog",
templateUrl: "entity-dialog.component.html",
})
export class EntityDialogComponent {
public entity: Entity;
public otherEntities: string;
constructor(
public dialogRef: MatDialogRef<EntityDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: IDialogData,
) { …Run Code Online (Sandbox Code Playgroud) 已解决问题:只需添加dynamicHeight到<mat-tab-group>
我目前有一张卡片(mat-card),里面有 2 个标签(现在你只能看到一个标签,但想法是解决这个问题以添加另一个;这将具有相同的内容,但将作为一个例子,因为它只是 Lorem Ipsum暂时文本),我不知道如何做的是删除滚动条并且内容只是不断向下拉伸卡片。
我正在使用 Angular 5,当然还有 Angular Material 5。
我尝试了通过 Google 和 StackOverflow 找到的几件事,但没有一个对我有用。我在网格系统中使用 Flexbox。
我的 lorem.component.html 代码:
<div class="content-padder content-background">
<div class="uk-section-small uk-section-default header">
<div class="uk-container uk-container-large uk-animation-slide-top-medium">
<h1><span uk-icon="credit-card"></span> Lorem</h1>
<p>Lorem</p>
<ul class="uk-breadcrumb">
<li><a href="#">Lorem</a></li>
<li><span href="">Lorem</span></li>
<li><span href="">Lorem</span></li>
</ul>
</div>
</div>
<div class="uk-section-small content-padder content-background">
<div class="container">
<mat-card>
<div class="mat-tab-fix">
<mat-tab-group>
<mat-tab class="tabs" label="Tab 1">
<h2 style="padding-top: 30px;">
<span>Lorem</span>
</h2>
<div class="card-layout">
<div class="card-column-1"> …Run Code Online (Sandbox Code Playgroud) 我有一个工作的零食吧,但它只在每个组件上,我想在我的服务上添加它,所以我会打电话给它.这是我的样本component.ts
import { MdSnackBar, MdSnackBarRef } from '@angular/material';
...
export class EmployeeListComponent implements OnInit {
public toastRef: MdSnackBarRef<any>;
constructor(private _activatedRoute:ActivatedRoute,private router: Router, private http:PMISHttpService, private toast: MdSnackBar) {
ngOnInit() {
this.notify('test');
}
...
notify (text: string) {
this.toastRef = this.toast.open(text, null);
setTimeout(() => {
this.toastRef.dismiss();
}, 5000);
}
...
}
Run Code Online (Sandbox Code Playgroud) 这是典型的Angular材质matInput:
<input matInput [(ngModel)]="model.property" name="property" />
Run Code Online (Sandbox Code Playgroud)
现在,当模型发生变化时应用逻辑,其他开发人员在SO中提出的一个常见解决方案就是将banry in the box打破为属性绑定器和事件挂钩表达式:
<input matInput [ngModel]="model.property" (ngModelChange)="model.property=someLogic($event)" />
Run Code Online (Sandbox Code Playgroud)
基于这个逻辑,我创建了一个digitGroup获取输入数字的函数,在每三个数字之间放置逗号,并在matInput字段中显示.
然而,问题是现在model.property是一个表示数字分组数字的字符串,而不是一个真正的JavaScript数字,因此在每个地方我需要访问它的值并对其进行一些数学运算,我需要先做undigitGroup(model.property).
是否有可能同时绑定matInput到两个属性model?这样我可以model.property进行计算并model.digitGroupedProperty同时向用户显示.
如何向 MaterialDatePicker 添加约束以强制用户仅选择 2 个日期之间的日期?
val constraintBuilder = CalendarConstraints.Builder()
val materialRangeBuilder = MaterialDatePicker.Builder.datePicker()
materialRangeBuilder.setTitleText("Book Date")
materialRangeBuilder.setCalendarConstraints(constraintBuilder.build())
val materialRangePicker = materialRangeBuilder.build()
materialRangePicker.addOnPositiveButtonClickListener {
Timber.d("$it")
}
materialRangePicker.show(supportFragmentManager, "DATE_RANGE_PICKER")
Run Code Online (Sandbox Code Playgroud) android android-datepicker kotlin material-components-android
在我的 Angular 应用程序(使用 Angular Material 设计)中,我需要使用 Material Table 显示一些数据。
该表有一个粘性页眉、几行和一个粘性页脚。
默认情况下,行的高度为 62.5px,我想覆盖这个值。
我怎样才能做到这一点?
我曾尝试覆盖 tr / tr.mat-row / tr.mat-header-row 等的 css 样式,但没有成功。我也尝试过使用 ::ng-deep 。
此外,我的粘性页脚行的高度为 48 像素,这是我没有设置的!!有谁知道发生了什么?
我可以使用 ::ng-deep 编辑页脚行 css,我已将 font-weight 设置为bold,但是当我设置 height 属性时,没有任何反应。
::ng-deep tr.mat-footer-row {
border: 1px solid #e7e7e7;
font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud) 我试图实现拖放回收器视图的拖放功能.此实现的文档中没有足够的信息.我假设我必须使用onchildmoved为事件监听器,但我不知道如何重新排序数据.
我做了这些步骤:
sudo xcode-select -switch /Applications/Xcode-beta.app/现在我正在尝试安装node8:
brew install node@8
Run Code Online (Sandbox Code Playgroud)
它给了我这个错误:
Error: The Command Line Tools header package must be installed on Mojave.
The installer is located at: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Run Code Online (Sandbox Code Playgroud)
还在,做
install -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Run Code Online (Sandbox Code Playgroud)
什么都不做,因为我的系统中没有这样的文件.我在哪里可以得到它?
平树:
在平面树中,层次结构是扁平的; 节点不会在彼此内部呈现,而是按顺序呈现为兄弟节点
嵌套树:
在嵌套树中,子节点放在DOM中的父节点内.父节点有一个插座,用于保留所有子节点.
我有一个800元素的命名法,我用平面树显示.
我首先尝试使用嵌套树,因为它看起来像是最合适的树.它需要眨眼才能构建它,但是DOM需要5秒才能加载树,所以我尝试了扁平的树,它现在完美地工作了.
问题是,如果扁平树的结果相同,那么使用嵌套树有什么意义呢?树正确呈现,DOM理解其层次结构.
平树的DOM:
嵌套树更难构建,并且每次显示时都会明显重载DOM.嵌套树可以做什么,平树不能做什么?材料文档不清楚.
angular ×7
android ×2
angular5 ×1
css ×1
flexbox ×1
homebrew ×1
java ×1
kotlin ×1
macos ×1
macos-mojave ×1
material-components-android ×1
snackbar ×1
tree ×1
typescript ×1