From 09be1dab5a810d38353d876b84b373ccbb1f1ff5 Mon Sep 17 00:00:00 2001 From: Ruin <1830275783@qq.com> Date: Fri, 4 Mar 2022 11:33:15 +0800 Subject: [PATCH] commit --- .editorconfig | 2 +- src/app/app-routing.module.ts | 16 +++++++++++- src/app/app.component.html | 2 +- src/app/app.component.scss | 8 ++++++ src/app/app.module.ts | 3 ++- src/app/components/components.module.ts | 22 +++++++++------- src/app/components/list/list.component.html | 1 + src/app/components/list/list.component.scss | 0 .../components/list/list.component.spec.ts | 25 +++++++++++++++++++ src/app/components/list/list.component.ts | 15 +++++++++++ src/app/components/news/news.component.html | 2 +- src/app/components/news/news.component.ts | 22 +++++++++++----- src/app/core/core.module.ts | 7 +++--- .../home/components/body/body.component.html | 24 +++++++++++++++++- .../home/components/body/body.component.ts | 20 +++++++++------ .../home/components/head/head.component.html | 11 +++++++- .../home/components/head/head.component.ts | 24 ++++++++++++++---- src/app/pages/home/home.component.html | 4 ++- src/app/pages/home/home.module.ts | 13 ++++++++-- src/app/pages/pages.module.ts | 12 +++++---- .../user/components/info/info.component.html | 1 + .../user/components/info/info.component.scss | 0 .../components/info/info.component.spec.ts | 25 +++++++++++++++++++ .../user/components/info/info.component.ts | 15 +++++++++++ .../user/components/mine/mine.component.html | 1 + .../user/components/mine/mine.component.scss | 0 .../components/mine/mine.component.spec.ts | 25 +++++++++++++++++++ .../user/components/mine/mine.component.ts | 15 +++++++++++ src/app/pages/user/user.component.html | 11 ++++++++ src/app/pages/user/user.component.scss | 0 src/app/pages/user/user.component.spec.ts | 25 +++++++++++++++++++ src/app/pages/user/user.component.ts | 15 +++++++++++ src/app/pages/user/user.module.ts | 20 +++++++++++++++ 33 files changed, 341 insertions(+), 45 deletions(-) create mode 100644 src/app/components/list/list.component.html create mode 100644 src/app/components/list/list.component.scss create mode 100644 src/app/components/list/list.component.spec.ts create mode 100644 src/app/components/list/list.component.ts create mode 100644 src/app/pages/user/components/info/info.component.html create mode 100644 src/app/pages/user/components/info/info.component.scss create mode 100644 src/app/pages/user/components/info/info.component.spec.ts create mode 100644 src/app/pages/user/components/info/info.component.ts create mode 100644 src/app/pages/user/components/mine/mine.component.html create mode 100644 src/app/pages/user/components/mine/mine.component.scss create mode 100644 src/app/pages/user/components/mine/mine.component.spec.ts create mode 100644 src/app/pages/user/components/mine/mine.component.ts create mode 100644 src/app/pages/user/user.component.html create mode 100644 src/app/pages/user/user.component.scss create mode 100644 src/app/pages/user/user.component.spec.ts create mode 100644 src/app/pages/user/user.component.ts create mode 100644 src/app/pages/user/user.module.ts diff --git a/.editorconfig b/.editorconfig index 59d9a3a..2ecd252 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ insert_final_newline = true trim_trailing_whitespace = true [*.ts] -quote_type = single +quote_type = double [*.md] max_line_length = off diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 526e1dc..3175414 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,12 +1,26 @@ +/* + * @Description: {{ByRuin}} + * @Version: 2.0 + * @Author: Ruin 🍭 + * @Date: 2022-03-03 16:21:23 + * @LastEditors: 刘引 + * @LastEditTime: 2022-03-04 10:52:53 + */ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { HomeComponent } from './pages/home/home.component'; +import { UserComponent } from './pages/user/user.component'; const routes: Routes = [ + // 路由前面的路径不需要加/ { - path: 'home', + path: '', component: HomeComponent, }, + { + path: 'user', + component: UserComponent, + }, ]; @NgModule({ diff --git a/src/app/app.component.html b/src/app/app.component.html index c6952bd..38ea303 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,7 +4,7 @@ * @Author: Ruin 🍭 * @Date: 2022-03-03 16:21:23 * @LastEditors: 刘引 - * @LastEditTime: 2022-03-03 17:23:41 + * @LastEditTime: 2022-03-04 11:00:55 --> diff --git a/src/app/app.component.scss b/src/app/app.component.scss index e69de29..62c165e 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -0,0 +1,8 @@ +* { + margin: 0; + padding: 0; +} +.w { + width: 1200px; + margin: 0 auto; +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8f377f1..e714d1f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,7 +4,7 @@ * @Author: Ruin 🍭 * @Date: 2022-03-03 16:21:23 * @LastEditors: 刘引 - * @LastEditTime: 2022-03-03 17:13:00 + * @LastEditTime: 2022-03-04 10:09:24 */ // 引入核心模块 import { NgModule } from '@angular/core'; @@ -16,6 +16,7 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; // @ngModule装饰器 @ngModule接受一个元数据对象 告诉angular如何编译和启动对象\ import { CoreModule } from './core/core.module'; + @NgModule({ declarations: [AppComponent], //配置项目运行的组件 imports: [BrowserModule, AppRoutingModule, CoreModule], //配置当前项目运行依赖的其他模块 diff --git a/src/app/components/components.module.ts b/src/app/components/components.module.ts index 089165f..416d959 100644 --- a/src/app/components/components.module.ts +++ b/src/app/components/components.module.ts @@ -1,15 +1,19 @@ +/* + * @Description: {{ByRuin}} + * @Version: 2.0 + * @Author: Ruin 🍭 + * @Date: 2022-03-03 16:58:41 + * @LastEditors: 刘引 + * @LastEditTime: 2022-03-04 10:54:07 + */ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { NewsComponent } from './news/news.component'; - - +import { ListComponent } from './list/list.component'; @NgModule({ - declarations: [ - NewsComponent - ], - imports: [ - CommonModule - ] + declarations: [NewsComponent, ListComponent], + imports: [CommonModule], + exports: [NewsComponent, ListComponent], }) -export class ComponentsModule { } +export class ComponentsModule {} diff --git a/src/app/components/list/list.component.html b/src/app/components/list/list.component.html new file mode 100644 index 0000000..7c1fe15 --- /dev/null +++ b/src/app/components/list/list.component.html @@ -0,0 +1 @@ +
list works!
diff --git a/src/app/components/list/list.component.scss b/src/app/components/list/list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/list/list.component.spec.ts b/src/app/components/list/list.component.spec.ts new file mode 100644 index 0000000..a5d3a5c --- /dev/null +++ b/src/app/components/list/list.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ListComponent } from './list.component'; + +describe('ListComponent', () => { + let component: ListComponent; + let fixture: ComponentFixturenews works!
+{{ msg }}
diff --git a/src/app/components/news/news.component.ts b/src/app/components/news/news.component.ts index bde03ca..da1a0f3 100644 --- a/src/app/components/news/news.component.ts +++ b/src/app/components/news/news.component.ts @@ -1,15 +1,25 @@ +/* + * @Description: {{ByRuin}} + * @Version: 2.0 + * @Author: Ruin 🍭 + * @Date: 2022-03-03 16:59:15 + * @LastEditors: 刘引 + * @LastEditTime: 2022-03-04 10:56:36 + */ + import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-news', templateUrl: './news.component.html', - styleUrls: ['./news.component.scss'] + styleUrls: ['./news.component.scss'], }) export class NewsComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { + public msg: string = '我是新闻模块'; + constructor() { + console.log(this.msg); + this.msg = '我是改变后msg的值'; + console.log(this.msg); } - + ngOnInit(): void {} } diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index dcefa1b..cb97f84 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -4,15 +4,16 @@ * @Author: Ruin 🍭 * @Date: 2022-03-03 16:48:51 * @LastEditors: 刘引 - * @LastEditTime: 2022-03-03 17:10:50 + * @LastEditTime: 2022-03-04 10:29:19 */ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { PagesModule } from '../pages/pages.module'; -// import { } +import { ComponentsModule } from '../components/components.module'; @NgModule({ declarations: [], - imports: [CommonModule, PagesModule], + imports: [CommonModule, PagesModule, ComponentsModule], + exports: [PagesModule, ComponentsModule], }) export class CoreModule {} diff --git a/src/app/pages/home/components/body/body.component.html b/src/app/pages/home/components/body/body.component.html index ee17f4e..b3115a2 100644 --- a/src/app/pages/home/components/body/body.component.html +++ b/src/app/pages/home/components/body/body.component.html @@ -1 +1,23 @@ -body works!
+ +body {{ content }}
+ + + +1+2 = {{ 1 + 2 }} + +head works!
+ +{{ userName }}{{ title }}
+我是一个p标签
diff --git a/src/app/pages/home/components/head/head.component.ts b/src/app/pages/home/components/head/head.component.ts index e68fdbc..fc8017e 100644 --- a/src/app/pages/home/components/head/head.component.ts +++ b/src/app/pages/home/components/head/head.component.ts @@ -1,15 +1,29 @@ +/* + * @Description: {{ByRuin}} + * @Version: 2.0 + * @Author: Ruin 🍭 + * @Date: 2022-03-03 17:07:14 + * @LastEditors: 刘引 + * @LastEditTime: 2022-03-04 10:23:02 + */ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-head', templateUrl: './head.component.html', - styleUrls: ['./head.component.scss'] + styleUrls: ['./head.component.scss'], }) export class HeadComponent implements OnInit { + public title = '我是头部组件'; + public userName: string = '张三'; + private age: number = 12; + protected school: string = 'xx中学'; - constructor() { } - - ngOnInit(): void { - } + public userInfo: object = { + userName: '李四', + age: 20, + }; + constructor() {} + ngOnInit(): void {} } diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index e018ec2..89dda1d 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -4,8 +4,10 @@ * @Author: Ruin 🍭 * @Date: 2022-03-03 17:06:15 * @LastEditors: 刘引 - * @LastEditTime: 2022-03-03 17:11:33 + * @LastEditTime: 2022-03-04 10:53:57 -->home works!
info works!
diff --git a/src/app/pages/user/components/info/info.component.scss b/src/app/pages/user/components/info/info.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/user/components/info/info.component.spec.ts b/src/app/pages/user/components/info/info.component.spec.ts new file mode 100644 index 0000000..fead35b --- /dev/null +++ b/src/app/pages/user/components/info/info.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InfoComponent } from './info.component'; + +describe('InfoComponent', () => { + let component: InfoComponent; + let fixture: ComponentFixturemine works!
diff --git a/src/app/pages/user/components/mine/mine.component.scss b/src/app/pages/user/components/mine/mine.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/user/components/mine/mine.component.spec.ts b/src/app/pages/user/components/mine/mine.component.spec.ts new file mode 100644 index 0000000..d996c34 --- /dev/null +++ b/src/app/pages/user/components/mine/mine.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MineComponent } from './mine.component'; + +describe('MineComponent', () => { + let component: MineComponent; + let fixture: ComponentFixtureuser works!
+