瀏覽代碼

dashboard component added to menu item.

tags/2.037
Patrick Sun 5 年之前
父節點
當前提交
a4145f153d
共有 12 個文件被更改,包括 87 次插入13 次删除
  1. +5
    -3
      src/app/app-routing.module.ts
  2. +6
    -2
      src/app/app.component.html
  3. +12
    -1
      src/app/app.component.scss
  4. +3
    -1
      src/app/app.module.ts
  5. +1
    -0
      src/app/dashboard/dashboard.component.html
  6. +0
    -0
      src/app/dashboard/dashboard.component.scss
  7. +25
    -0
      src/app/dashboard/dashboard.component.spec.ts
  8. +15
    -0
      src/app/dashboard/dashboard.component.ts
  9. +5
    -1
      src/app/dist/app-routing.module.js
  10. +11
    -1
      src/app/dist/app.component.css
  11. +2
    -2
      src/app/dist/main-menu-items.js
  12. +2
    -2
      src/app/main-menu-items.ts

+ 5
- 3
src/app/app-routing.module.ts 查看文件

import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { DashboardComponent } from './dashboard/dashboard.component';




const routes: Routes = [];
const routes: Routes = [
{path : '', component: DashboardComponent},
{path : 'dashboard', component: DashboardComponent}
];


@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes)], imports: [RouterModule.forRoot(routes)],

+ 6
- 2
src/app/app.component.html 查看文件

<kendo-contextmenu [target]="target" [items]="items"> </kendo-contextmenu>
<div class=topMenuBar >
<kendo-menu [items]="items"> </kendo-menu>
</div>

<router-outlet></router-outlet>
<div #target class="target"> <div #target class="target">
<p class="placeholder">Right-click to open Context menu</p> <p class="placeholder">Right-click to open Context menu</p>
</div> </div>
<kendo-contextmenu [target]="target" [items]="items"> </kendo-contextmenu>
<kendo-menu [items]="items"> </kendo-menu>

+ 12
- 1
src/app/app.component.scss 查看文件

border-radius: 5px; border-radius: 5px;
height: 100px; height: 100px;
width: 400px; width: 400px;
background-color: #f6f6f6;
background-color: yellowgreen;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 20px; font-size: 20px;
color: #656565; color: #656565;
margin: 0; margin: 0;
}

.topMenuBar {
left: 0px;
top: 0px;
// position: absolute;
margin : 0px;
width : 100%;
display: block;
background-color: rgb(229, 230, 218);
box-shadow : 0px 0px 2px 0px #d6d2d2
} }

+ 3
- 1
src/app/app.module.ts 查看文件

//App //App
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { DashboardComponent } from './dashboard/dashboard.component';




@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent
AppComponent,
DashboardComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,

+ 1
- 0
src/app/dashboard/dashboard.component.html 查看文件

<p>dashboard works!</p>

+ 0
- 0
src/app/dashboard/dashboard.component.scss 查看文件


+ 25
- 0
src/app/dashboard/dashboard.component.spec.ts 查看文件

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DashboardComponent } from './dashboard.component';

describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DashboardComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 15
- 0
src/app/dashboard/dashboard.component.ts 查看文件

import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}

+ 5
- 1
src/app/dist/app-routing.module.js 查看文件

exports.AppRoutingModule = void 0; exports.AppRoutingModule = void 0;
var core_1 = require("@angular/core"); var core_1 = require("@angular/core");
var router_1 = require("@angular/router"); var router_1 = require("@angular/router");
var routes = [];
var dashboard_component_1 = require("./dashboard/dashboard.component");
var routes = [
{ path: '', component: dashboard_component_1.DashboardComponent },
{ path: 'dashboard', component: dashboard_component_1.DashboardComponent }
];
var AppRoutingModule = /** @class */ (function () { var AppRoutingModule = /** @class */ (function () {
function AppRoutingModule() { function AppRoutingModule() {
} }

+ 11
- 1
src/app/dist/app.component.css 查看文件

border-radius: 5px; border-radius: 5px;
height: 100px; height: 100px;
width: 400px; width: 400px;
background-color: #f6f6f6;
background-color: yellowgreen;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 20px; font-size: 20px;
color: #656565; color: #656565;
margin: 0; margin: 0;
}

.topMenuBar {
left: 0px;
top: 0px;
margin: 0px;
width: 100%;
display: block;
background-color: #e5e6da;
box-shadow: 0px 0px 2px 0px #d6d2d2;
} }

+ 2
- 2
src/app/dist/main-menu-items.js 查看文件

exports.mainMenuItems = [ exports.mainMenuItems = [
{ {
text: 'Item1a中文', text: 'Item1a中文',
items: [{ text: 'Item1.1' }, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }]
items: [{ text: 'Item1.1', url: '/dashboard' }, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }]
}, },
{ {
text: 'Item2', text: 'Item2',
items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
items: [{ text: 'Item2.1', url: 'https://google.com.au' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
}, },
{ {
text: 'Item3' text: 'Item3'

+ 2
- 2
src/app/main-menu-items.ts 查看文件

export const mainMenuItems: any[] = [ export const mainMenuItems: any[] = [
{ {
text: 'Item1a中文', text: 'Item1a中文',
items: [{ text: 'Item1.1' }, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }]
items: [{ text: 'Item1.1', url: '/dashboard'}, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }]
}, },
{ {
text: 'Item2', text: 'Item2',
items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
items: [{ text: 'Item2.1', url: 'https://google.com.au' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
}, },
{ {
text: 'Item3' text: 'Item3'

Loading…
取消
儲存