Skip to content

Commit

Permalink
feat: element-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
logustra committed Mar 20, 2021
1 parent 9fff0a0 commit 0fd22ce
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 12 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"commitizen": "^4.2.3",
"cz-conventional-changelog": "^3.3.0",
"dotenv-cli": "^4.0.0",
"element-plus": "^1.0.2-beta.35",
"eslint": "^7.21.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
Expand All @@ -81,6 +82,7 @@
"vite-plugin-components": "^0.8.0",
"vite-plugin-fonts": "^0.1.5",
"vite-plugin-icons": "^0.3.2",
"vite-plugin-importer": "^0.2.0",
"vue": "^3.0.7",
"vue-eslint-parser": "^7.6.0",
"vue-router": "4",
Expand Down
97 changes: 89 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/modules/Home/views/home.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<div>
Bismillah, Hello World!
<CilGlobeAlt class="inline" />
<div class="flex justify-center items-center flex-col">
<div>
Bismillah, Hello World!
<CilGlobeAlt class="inline" />
</div>
<ElButton>
👋
</ElButton>
</div>
</template>

Expand Down
22 changes: 21 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import ViteComponents from 'vite-plugin-components'
import ViteComponents, { ElementPlusResolver } from 'vite-plugin-components'
import ViteIcons, { ViteIconsResolver } from 'vite-plugin-icons'
import ViteFonts from 'vite-plugin-fonts'
import ViteImport from 'vite-plugin-importer'

export default defineConfig({
plugins: [
Expand All @@ -15,10 +16,20 @@ export default defineConfig({
*/
ViteComponents({
customComponentResolvers: [
/**
* DESC:
* auto import iconify
*/
ViteIconsResolver({
componentPrefix: '',
enabledCollections: ['cil']
}),

/**
* DESC:
* auto import element-plus
*/
ElementPlusResolver()
],
}),

Expand All @@ -33,6 +44,15 @@ export default defineConfig({
families: ['Source Sans Pro']
},
}),

/**
* DESC:
* on-demand element-plus
*/
ViteImport({
libraryName: 'element-plus',
style: true
})
],

/**
Expand Down

0 comments on commit 0fd22ce

Please sign in to comment.