• 添加material ui库


    ng add @angular/material

      自定义预构建主题

    ? Choose a prebuilt theme name, or "custom" for a custom theme: Custom
    ? Set up global Angular Material typography styles? Yes
    ? Set up browser animations for Angular Material? Yes

      创建mat.module

    ng g module mat

      写个例子

    import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { MatButtonModule } from '@angular/material/button';
    
    
    @NgModule({
      declarations: [],
      imports: [
        CommonModule,
        MatButtonModule 
      ],
      exports:[
        MatButtonModule
      ]
    })
    export class MatModule { }

       然后只需要在用到这个组件的module导入

    import { MatModule } from 'src/app/mat/mat.module';
      imports: [
        MatModule,
      ],

       即可使用,如

    <button mat-button>按钮</button>
  • 相关阅读:
    Mac OS X开发学习 -打开文件选择器并获取文件
    Mac OS X开发学习
    第三方开源
    Xcode操作
    Mac操作
    XCode6.1 错误
    ios 本地推送
    IOS 语法
    IOS 其他
    IOS 语法
  • 原文地址:https://www.cnblogs.com/wskxy/p/14236840.html
Copyright © 2020-2023  润新知