将 element plus 反馈组件改为手动引入

This commit is contained in:
hooray 2022-10-23 14:17:15 +08:00
parent a17c531340
commit 08bef75035
18 changed files with 15 additions and 25 deletions

View File

@ -1,5 +1,4 @@
{
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build:example": "vue-tsc --noEmit && vite build --mode example",

View File

@ -1,5 +1,6 @@
import axios from 'axios'
// import qs from 'qs'
import { ElMessage } from 'element-plus'
import router from '@/router/index'
import useUserStore from '@/store/modules/user'

View File

@ -2,9 +2,6 @@
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElLoading: typeof import('element-plus/es')['ElLoading']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElNotification: typeof import('element-plus/es')['ElNotification']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']

View File

@ -1,5 +1,5 @@
<script lang="ts" setup name="FileUpload">
import { UploadUserFile } from 'element-plus'
import { ElMessage, UploadUserFile } from 'element-plus'
import type { UploadProps } from 'element-plus'
const props = defineProps({

View File

@ -1,5 +1,6 @@
<script lang="ts" setup name="ImageUpload">
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
const props = defineProps({
action: {

View File

@ -1,5 +1,6 @@
<script lang="ts" setup name="ImagesUpload">
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
const props = defineProps({
action: {

View File

@ -16,9 +16,6 @@ onMounted(() => {
<div>
<el-drawer v-model="isShow" title="系统信息" direction="rtl" :size="360">
<el-descriptions direction="vertical" :column="1" border>
<el-descriptions-item label="版本号" align="center">
{{ pkg.version }}
</el-descriptions-item>
<el-descriptions-item label="最后编译时间" align="center">
{{ lastBuildTime }}
</el-descriptions-item>

View File

@ -1,5 +1,6 @@
<script lang="ts" setup name="AppSetting">
import { useClipboard } from '@vueuse/core'
import { ElMessage } from 'element-plus'
import eventBus from '@/utils/eventBus'
import useSettingsStore from '@/store/modules/settings'
import useMenuStore from '@/store/modules/menu'

View File

@ -1,4 +1,6 @@
<script lang="ts" setup name="BuyIt">
import { ElNotification } from 'element-plus'
const isActived = ref(true)
setTimeout(() => {
isActived.value = false

View File

@ -5,6 +5,7 @@ meta:
<script lang="ts" setup name="ComponentExampleArea">
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
const pcas1 = ref([])
const pcas2 = ref([])

View File

@ -5,6 +5,7 @@ meta:
<script lang="ts" setup name="ComponentExampleUpload">
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
const image = ref('https://picsum.photos/400')
const images = ref([

View File

@ -7,6 +7,7 @@ meta:
<script lang="ts" setup name="Login">
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
const route = useRoute()

View File

@ -4,6 +4,7 @@ meta:
</route>
<script lang="ts" setup>
import { ElNotification } from 'element-plus'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()

View File

@ -4,6 +4,7 @@ meta:
</route>
<script lang="ts" setup>
import { ElLoading, ElMessage } from 'element-plus'
import useSettingsStore from '@/store/modules/settings'
import useUserStore from '@/store/modules/user'

View File

@ -6,6 +6,7 @@ meta:
<script lang="ts" setup name="PersonalEditPassword">
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
const route = useRoute()

View File

@ -7,6 +7,7 @@ meta:
<script lang="ts" setup name="PersonalSetting">
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
const router = useRouter()

View File

@ -11,8 +11,7 @@ export default ({ mode, command }) => {
// 全局 scss 资源
const scssResources = []
fs.readdirSync('src/assets/styles/resources').forEach((dirname) => {
if (fs.statSync(`src/assets/styles/resources/${dirname}`).isFile())
scssResources.push(`@use "src/assets/styles/resources/${dirname}" as *;`)
if (fs.statSync(`src/assets/styles/resources/${dirname}`).isFile()) { scssResources.push(`@use "src/assets/styles/resources/${dirname}" as *;`) }
})
// css 精灵图相关
fs.readdirSync('src/assets/sprites').forEach((dirname) => {
@ -43,23 +42,12 @@ export default ({ mode, command }) => {
define: {
__SYSTEM_INFO__: JSON.stringify({
pkg: {
version: pkg.version,
dependencies: pkg.dependencies,
devDependencies: pkg.devDependencies,
},
lastBuildTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}),
},
optimizeDeps: {
include: [
'element-plus',
'element-plus/es',
'element-plus/es/components/message/style/css',
'element-plus/es/components/notification/style/css',
'element-plus/es/components/message-box/style/css',
'element-plus/es/components/loading/style/css',
],
},
plugins: createVitePlugins(env, command === 'build'),
resolve: {
alias: {

View File

@ -1,5 +1,4 @@
import autoImport from 'unplugin-auto-import/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default function createAutoImport() {
return autoImport({
@ -12,8 +11,5 @@ export default function createAutoImport() {
dirs: [
'./src/utils/composables/**',
],
resolvers: [
ElementPlusResolver(),
],
})
}