调整友链页面样式
This commit is contained in:
@@ -4,6 +4,7 @@ import {Title} from '@angular/platform-browser';
|
||||
import {ApiService} from '../../api/api.service';
|
||||
import {ApplyLinkReq, Link} from '../../class/Link';
|
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
||||
import {Color, RandomColor} from '../../utils/color';
|
||||
|
||||
@Component({
|
||||
selector: 'view-link',
|
||||
@@ -28,13 +29,16 @@ export class LinkComponent implements OnInit {
|
||||
linkList: Link[];
|
||||
loading: boolean = false;
|
||||
applyFormGroup: FormGroup;
|
||||
colors: Color[];
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
window.scrollTo(0, 0);
|
||||
this.link = new Link();
|
||||
this.apiService.links().subscribe({
|
||||
next: data => this.linkList = data.result,
|
||||
error: err => this.message.error(err.msg)
|
||||
error: err => this.message.error(err.msg),
|
||||
complete: () => this.colors = RandomColor(this.linkList.length)
|
||||
});
|
||||
this.applyFormGroup = this.fb.group({
|
||||
urlLinkProtocol: ['http://'],
|
||||
|
||||
Reference in New Issue
Block a user