全局页脚
IMPORT MODULE

页脚属于全局导航的一部分,作为对顶部导航的补充,通过传递数据控制展示内容。

代码演示

演示

基本页脚。

expand code expand code
import { Component } from '@angular/core';

import { GlobalFooterComponent, GlobalFooterLink } from '@yelon/abc/global-footer';
import { NzIconModule } from 'ng-zorro-antd/icon';

@Component({
  selector: 'components-global-footer-basic',
  template: `
    <div style="height: 280px;"></div>
    <global-footer [links]="links">
      Copyright<i nz-icon nzType="copyright" class="mx-sm"></i>
      2023
      <a href="//github.com/yunzai-bot" target="_blank" class="mx-sm">yunzai-bot</a>出品
    </global-footer>
  `,
  styles: [
    `
      :host {
        display: block;
      }
    `
  ],
  standalone: true,
  imports: [GlobalFooterComponent, NzIconModule]
})
export class ComponentsGlobalFooterBasicComponent {
  links: GlobalFooterLink[] = [
    {
      title: '帮助',
      href: 'https://ng.yunzainfo.com/',
      blankTarget: true
    },
    {
      title: 'Github',
      href: 'https://github.com/hbyunzai',
      blankTarget: true
    },
    {
      title: '预览',
      href: 'https://ng-yunzai.surge.sh/',
      blankTarget: true
    }
  ];
}
自定义

使用 global-footer-item 自定义图标。

expand code expand code
import { Component } from '@angular/core';

import { GlobalFooterModule } from '@yelon/abc/global-footer';
import { NzIconModule } from 'ng-zorro-antd/icon';

@Component({
  selector: 'components-global-footer-custom',
  template: `
    <div style="height: 280px;"></div>
    <global-footer>
      <global-footer-item href="https://ng.yunzainfo.com/" blankTarget>帮助</global-footer-item>
      <global-footer-item href="https://github.com/hbyunzai" blankTarget>
        <i nz-icon nzType="github"></i>
      </global-footer-item>
      <global-footer-item href="https://ng-yunzai.surge.sh/" blankTarget>预览</global-footer-item>
      Copyright<i nz-icon nzType="copyright" class="mx-sm"></i>
      2023
      <a href="//github.com/yunzai-bot" target="_blank" class="mx-sm">yunzai-bot</a>出品
    </global-footer>
  `,
  styles: [
    `
      :host {
        display: block;
      }
    `
  ],
  standalone: true,
  imports: [GlobalFooterModule, NzIconModule]
})
export class ComponentsGlobalFooterCustomComponent {}

API

参数说明类型默认值
[links]链接数据GlobalFooterLink-
[copyright]版权信息TemplateRef-
参数说明类型默认值
ng-content标题string-
[href]路由链接string-
[blankTarget]是否打开新窗口booleanfalse
参数说明类型默认值
[title]标题string-
[href]路由链接string-
[blankTarget]是否打开新窗口booleanfalse
Loading...