chore: update

This commit is contained in:
zazzaz 2020-09-15 17:12:16 +08:00 committed by hangzou
parent cdd451d158
commit 2f8c74078e
4 changed files with 18 additions and 9 deletions

View File

@ -8,12 +8,15 @@ const babelOptions = {
module.exports = {
mode: 'production',
entry: {
index: path.resolve(__dirname, '../packages/element-plus/index.ts'),
},
entry: path.resolve(__dirname, '../packages/element-plus/index.ts'),
output: {
path: path.resolve(__dirname, '../lib'),
publicPath: '/',
filename: 'index.js',
libraryTarget: 'umd',
libraryExport: 'default',
library: 'ELEMENT',
umdNamedDefine: true,
},
stats: 'verbose',
module: {
@ -77,7 +80,7 @@ module.exports = {
extensions: ['.ts', '.tsx', '.js', '.vue', '.json'],
},
externals: {
vue: 'Vue',
vue: 'vue',
},
plugins: [
new VueLoaderPlugin(),

View File

@ -72,7 +72,7 @@ export {
ElInfiniteScroll,
}
export default function install(app: App): void {
const install = (app: App): void => {
ElAlert(app)
ElAvatar(app)
ElBacktop(app)
@ -109,3 +109,9 @@ export default function install(app: App): void {
ElDialog(app)
ElInfiniteScroll(app)
}
const elementUI = {
install,
}
export default elementUI

View File

@ -15,7 +15,7 @@ import './assets/styles/fonts/style.css'
import icon from './icon.json'
import App from './app.vue'
import install from 'element-plus'
import ElementPlus from 'element-plus'
if(process.env.NODE_ENV === 'development') require('../src/style/element-ui@2.13.2.css')
@ -40,12 +40,12 @@ app.component('MainFooter', MainFooter)
app.component('MainHeader', MainHeader)
app.component('SideNav', SideNav)
app.component('FooterNav', FooterNav)
install(app)
const router = createRouter({
history: createWebHashHistory(),
routes,
})
app.use(ElementPlus)
app.use(router)
router.isReady().then(()=>{

View File

@ -1,8 +1,8 @@
import { createApp } from 'vue'
import install from 'element-plus'
import ElementPlus from 'element-plus'
import App from './play/index.vue'
import '../packages/theme-chalk/src/index.scss'
const app = createApp(App)
install(app)
app.use(ElementPlus)
app.mount('#app')