我一直在尝试在 React 中导入一些 mp3 和 wav 文件,但是在编译时遇到了一些错误,这些错误似乎与加载器有关。
不同的语法。
{
test: /\.(mp3|wav)$/,
use: {
loader: 'file-loader',
},
},
Uncaught Error: Module parse failed: Unexpected character '' (1:3)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
import sad from './sad.mp3';
this.wrongSound = new Audio(sad);
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用。然而,这根本不需要加载器:
this.wrongSound = new Audio('./src/sad.mp3');
Run Code Online (Sandbox Code Playgroud)
我想知道这是为什么。
我想在 Ant Design 中更改 Select 组件的占位符颜色。
我在下面尝试过这些,但它们都不起作用。
.ant-select-selection {
:placeholder-shown {
color: red !important;
}
&:placeholder-shown {
color: red !important;
}
:::placeholder {
color: red !important;
}
color: black !important;
&::-webkit-input-placeholder {
color: blue !important;
}
&:placeholder {
color: blue !important;
}
:placeholder {
color: blue !important;
}
::-webkit-input-placeholder {
color: blue !important;
}
}
::-webkit-input-placeholder {
color: blue !important;
}
Run Code Online (Sandbox Code Playgroud)