From f8f2ca0054019bb989302aaaab6f8ab263c7be21 Mon Sep 17 00:00:00 2001 From: "690405541@qq.com" <690405541@qq.com> Date: Tue, 7 Nov 2017 19:37:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=85=A8=E5=B1=80=E5=B8=83=E5=B1=80):=20?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/shared/layouts/index.ts | 4 ++ src/app/shared/layouts/layouts.component.html | 12 ++++++ src/app/shared/layouts/layouts.component.scss | 40 +++++++++++++++++++ .../shared/layouts/layouts.component.spec.ts | 25 ++++++++++++ src/app/shared/layouts/layouts.component.ts | 20 ++++++++++ 5 files changed, 101 insertions(+) create mode 100644 src/app/shared/layouts/index.ts create mode 100644 src/app/shared/layouts/layouts.component.html create mode 100644 src/app/shared/layouts/layouts.component.scss create mode 100644 src/app/shared/layouts/layouts.component.spec.ts create mode 100644 src/app/shared/layouts/layouts.component.ts diff --git a/src/app/shared/layouts/index.ts b/src/app/shared/layouts/index.ts new file mode 100644 index 0000000..a00321b --- /dev/null +++ b/src/app/shared/layouts/index.ts @@ -0,0 +1,4 @@ +export * from './layouts.component'; +export * from './sider/sider.component'; +export * from './header/header.component'; +export * from './footer/footer.component'; diff --git a/src/app/shared/layouts/layouts.component.html b/src/app/shared/layouts/layouts.component.html new file mode 100644 index 0000000..82299e0 --- /dev/null +++ b/src/app/shared/layouts/layouts.component.html @@ -0,0 +1,12 @@ + +
+ +
+
+ +
+ +
+
\ No newline at end of file diff --git a/src/app/shared/layouts/layouts.component.scss b/src/app/shared/layouts/layouts.component.scss new file mode 100644 index 0000000..f48fd2a --- /dev/null +++ b/src/app/shared/layouts/layouts.component.scss @@ -0,0 +1,40 @@ +.g-layout-sider { + position: relative; + transition: all .2s; + background: #001529; + min-width: 0; + min-height: 100vh; + box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); + z-index: 10; + max-width: 256px; + min-width: 256px; + width: 256px; + float: left; + &.layout-sider-collapsed { + max-width: 80px; + min-width: 80px; + width: 80px; + } +} + +.g-layout { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-flex: 1; + -ms-flex: auto; + flex: auto; + background: #f0f2f5; +} + +.layout-content { + margin: 24px 24px 0px; + height: 100%; + -webkit-box-flex: 1; + -ms-flex: auto; + flex: auto; +} \ No newline at end of file diff --git a/src/app/shared/layouts/layouts.component.spec.ts b/src/app/shared/layouts/layouts.component.spec.ts new file mode 100644 index 0000000..ec4e0a2 --- /dev/null +++ b/src/app/shared/layouts/layouts.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LayoutsComponent } from './layouts.component'; + +describe('LayoutsComponent', () => { + let component: LayoutsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LayoutsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LayoutsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/layouts/layouts.component.ts b/src/app/shared/layouts/layouts.component.ts new file mode 100644 index 0000000..3edd324 --- /dev/null +++ b/src/app/shared/layouts/layouts.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-layouts', + templateUrl: './layouts.component.html', + styleUrls: ['./layouts.component.scss'] +}) +export class LayoutsComponent implements OnInit { + _fold: boolean; + constructor() { } + + ngOnInit() { + } + + toggleSider(event) { + console.log(event); + this._fold = event; + } + +}