使用element-plus的提示组件时样式不显示
import { ElNotification } from 'element-plus';
ElNotification({
message: err.response.data.msg || '请求失败',
type: 'error',
duration: 3000
})
如下图所示:
解决方案
入口文件(main.ts/js)中引入相关样式即可
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
const app = createApp(App);
app.use(router);
app.mount('#app');
import 'virtual:windi.css';
import "element-plus/theme-chalk/el-notification.css";