美文网首页
Materialize 遇到的问题

Materialize 遇到的问题

作者: 晨曦Bai | 来源:发表于2019-07-08 14:23 被阅读0次

遇到的问题:

1. because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. 或者不显示设置的背景颜色

 <link type="text/css" rel="stylesheet" href="../node_modules/materialize-css/dist/css/materialize.min.css"
    media="screen,projection" />
  • 只需要修改 angular.json
    "styles": [
    "src/styles.css",
    "node_modules/materialize-css/dist/css/materialize.min.css"
    ]

2. dropdown 不能使用

解决方法: 加入下面的javascript 代码激活 menu

document.addEventListener('DOMContentLoaded', function() {
    var elems = document.querySelectorAll('.dropdown-trigger');
    var instances = M.Dropdown.init(elems, options);
  });

To activate the dropdown menu, insert this line of code into your JavaScript file, within the $( document ).ready(function) block

By default, the dropdown menu is activated by hovering over the dropdown trigger. To activate the dropdown menu on click, pass { hover: false } into the above dropdown() function

3. search bar 格式丑陋

nav .nav-wrapper form, nav .nav-wrapper form .input-field{
height: 100%;
} 这个貌似不起作用,下面的有用
input[type="search"] {
height: 64px !important; /* or height of nav */
}

相关文章

网友评论

      本文标题:Materialize 遇到的问题

      本文链接:https://www.haomeiwen.com/subject/lebohctx.html