html - Angular 4 Material组件订购

标签 html css angular angular-material

前端技术的 super 初学者我正在使用一些 Material 组件开发 Angular 4 应用程序。我试图在一行中显示我所有的 Material 组件。但是我找不到像 mat-group-element 这样的 Material 指令,这是我目前的代码:

我的 main-component.css :

 .sqltool-input {
    display:inline-block
  }

  .sqltool-select {
    display:inline-block
  }

  .sqltool-toggle {
    display:inline-block
  }

我的main-component.html:

<form class="sqltool-form">
   <!-- COMPONENT 1 -->  
   <mat-form-field class="sqltool-matform">
     <input class="sqltool-input" matInput placeholder="Enter SQL request">

    <!-- COMPONENT 2 --> 
    <mat-select class="sqltool-select" placeholder="Base" [(ngModel)]="dataSource">
        <mat-option value="Base1">Base 1</mat-option>
        <mat-option value="Base2">Base 2</mat-option>
    </mat-select>

    <!-- COMPONENT 3 --> 
    <mat-slide-toggle class="sqltool-toggle" [checked]="checked" color="primary">
        File generation
    </mat-slide-toggle>
  </mat-form-field>
</form>

enter image description here

有什么想法吗?

最佳答案

documentation 中所述;只有三种 Material 组件设计用于在 mat-form-field 内工作:

  • 输入matInput & textarea matInput
  • 垫选择
  • 垫片列表

关于html - Angular 4 Material组件订购,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50042402/

相关文章:

jquery - 如何更改我刚刚在代码中创建的 div 的 css

angular - 对包含 ngbTypeahead 的组件进行单元测试

html - 如何将特定内容居中?

html - 在嵌入式 Flash 文件周围添加链接

html - 有没有办法减少带有边距或其他元素的高度?

javascript - Html5 视频播放器在自动播放时必须按暂停两次

html - 显示 : table-cell height within absolute display:table (in Chrome only) 的不稳定行为

Angular 2 Modal Service插入动态(未知)组件

Angular 相同的元素在不同的屏幕尺寸上具有不同的绑定(bind)

javascript - 如何使用 jquery 显示子菜单?