-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
542d913
commit 83534a9
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './page-header.component'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<sim-breadcrumb></sim-breadcrumb> | ||
<div class="detail"> | ||
<ng-container *ngIf="heading"> | ||
<div class="row"> | ||
<h2 class="heading">{{heading}}</h2> | ||
</div> | ||
</ng-container> | ||
<ng-container *ngIf="content"> | ||
<div class="row" fxLayout="row" fxLayoutAlign="start start"> | ||
<div class="content-wrapper" fxFlex="100%"> | ||
<ng-content select="[header-content]"></ng-content> | ||
</div> | ||
<div class="extra-wrapper" fxFlex="auto"> | ||
<ng-content select="[header-extra]"></ng-content> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</div> | ||
<ng-content select="[header-other]"></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.g-page-header { | ||
position: relative; | ||
display: block; | ||
background: #fff; | ||
padding: 16px 32px 0 32px; | ||
border-bottom: 1px solid #e8e8e8; | ||
.title { | ||
margin-bottom: 16px; | ||
font-size: 20px; | ||
font-weight: 500; | ||
color: rgba(0, 0, 0, 0.85); | ||
} | ||
.content-wrapper{ | ||
margin-bottom: 16px; | ||
} | ||
.extra-wrapper{ | ||
text-align: right; | ||
margin-bottom: 16px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { PageHeaderComponent } from './page-header.component'; | ||
|
||
describe('PageHeaderComponent', () => { | ||
let component: PageHeaderComponent; | ||
let fixture: ComponentFixture<PageHeaderComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ PageHeaderComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(PageHeaderComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, OnInit, Input, HostBinding, ViewEncapsulation } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-page-header', | ||
templateUrl: './page-header.component.html', | ||
styleUrls: ['./page-header.component.scss'], | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
export class PageHeaderComponent implements OnInit { | ||
@HostBinding('class.g-page-header') true; | ||
// 标题 | ||
@Input() heading: string; | ||
// 是否有内容 | ||
@Input() content: boolean; | ||
// 是否有其他信息 | ||
@Input() other: boolean; | ||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |