Unlike element UI, element plus does not use node sass or dart sass, but sass and sass loader. At first, I thought it might be that the sass version and sass loader version of the project are inconsistent with the version of element plus, so I deleted the version of my project and installed the version consistent with the version used by element plus, but the problem is not solved. The version is as follows:
"devDependencies": {
"postcss-loader": "^5.3.0",
"sass": "^1.35.1",
"sass-loader": "^10.0.1",
}
After tossing around for a while, I found an article on the Internet (the solution of icon garbled code packaged by dart sass compiled element UI). This is a solution for element UI, but I don’t know whether it is effective for element plus. Therefore, after using this method for element plus according to the instructions, I found that it is also effective, so I made a record, The steps are as follows:
1. Install the plug-in CSS Unicode loader;
yarn add css-unicode-loader -D //npm install css-unicode-loader -D
2. In vue.config.js configuration, I used the object writing method, and here it is modified to function writing method
// vue.config.js
module.exports = {
configureWebpack: config => {
config.module.rules.filter(rule => {
return rule.test.toString().indexOf("scss") !== -1;
}).forEach(rule => {
rule.oneOf.forEach(oneOfRule => {
oneOfRule.use.splice(oneOfRule.use.indexOf(require.resolve('sass-loader')), 0,
{ loader: require.resolve("css-unicode-loader")})
})
})
}
}
Read More:
- The problem that the El icons icon cannot be displayed in vue3 + element plus + vite
- Vue element UI uses this. $notify is not a function problem resolution using the notification box
- Disordered code of idea properties file
- Invalid use of element UI icon by vite
- Vue element admin configure global styles
- It is invalid to submit the content directly after pasting it on the mobile terminal of Vue HTML5 editor
- [Problem] When installing the installation package, it appears: ipersistfile save failed with error code “0×80070005
- Online problem solving analysis
- The spring boot project was first created, pom.xml The error is Maven configuration problem. How to solve it?
- An error is reported when installing the package directly in pycharm, but it can be installed through the terminal. Error non zero exit code (2)
- Solve the problem of using in tensoft 2. X tf.contrib.slim No module named appears in the package: tensorflow.contrib problem
- The problem of MAC switching JDK version and RN Android JDK version leads to compilation failure. Solve it
- Solve the problem of “error empty block statement no empty” in the console (Vue project)
- JS Mobile Page to determine whether it is iPhone X, and then set the corresponding height of the element?
- Solve the problem of showing unregistered (unknown custom element) when importing components into Ant Design Pro
- How to solve the cross domain problem of Axios in Vue project
- Solve geforce error code with super full solution CODE:0x0003 Problem approach
- To solve the problem, start eclipse and return exit code = 13
- Two lines of code to solve your vs flashback problem
- Clion appears cmake error: could not find cmake_ Root! What is the problem and how to solve it?