【发布时间】:2018-12-08 02:14:05
【问题描述】:
我正在尝试向我的网站添加一个基本的 MDC 选择菜单。但它并不完全正确 - 框的右侧显示了 MDC 箭头以及普通的 HTML 箭头,并且这些文字放置在离菜单标签太近的位置 (seen here)。
HTML 部分——
<div class="mdc-select mdc-select--box day-select">
<select class="mdc-select__native-control" required>
<option value="" disabled selected></option>
<option value="grains">
Bread, Cereal, Rice, and Pasta
</option>
<option value="vegetables">
Vegetables
</option>
<option value="fruit">
Fruit
</option>
</select>
<label class="mdc-floating-label">Pick a Food Group</label>
<div class="mdc-line-ripple"></div>
</div>
app.scss 部分
@import "@material/select/mdc-select";
以及最后的 app.js 部分
import {MDCSelect} from '@material/select';
new MDCSelect(document.querySelector('.day-select'));
似乎我拥有我需要的一切,但我显然错过了一些愚蠢的东西。任何建议都值得赞赏 - 谢谢!
【问题讨论】:
标签: html material-design material-components material-components-web mdc-components