build(deps): 添加smooth-scroll插件、axios封装

This commit is contained in:
Soybean
2021-05-29 03:02:15 +08:00
parent afd4d04110
commit 82411cc5eb
29 changed files with 504 additions and 24 deletions

View File

@ -1,5 +1,7 @@
import type { App } from 'vue';
import 'element-plus/lib/theme-chalk/base.css';
import lang from 'element-plus/lib/locale/lang/zh-cn';
import 'dayjs/locale/zh-cn';
import {
// ElAlert,
// ElAside,
@ -26,7 +28,7 @@ import {
ElCollapseTransition,
// ElColorPicker,
// ElContainer,
// ElDatePicker,
ElDatePicker,
// ElDialog,
// ElDivider,
// ElDrawer,
@ -81,10 +83,11 @@ import {
// ElTree,
// ElUpload,
// ElInfiniteScroll,
ElLoading
ElLoading,
// ElMessage
// ElMessageBox,
// ElNotification
locale
} from 'element-plus';
const components = [
@ -113,7 +116,7 @@ const components = [
ElCollapseTransition,
// ElColorPicker,
// ElContainer,
// ElDatePicker,
ElDatePicker,
// ElDialog,
// ElDivider,
// ElDrawer,
@ -179,6 +182,8 @@ const plugins = [
/** 引入element-plus UI组件 */
export default function setupElementPlus(app: App<Element>) {
/** 国际化 */
locale(lang);
components.forEach(component => {
app.component(component.name, component);
});

View File

@ -1,4 +1,5 @@
import setupSmoothScroll from './smooth-scroll';
import setupElementPlus from './element-plus';
import NProgress from './nprogress';
export { setupElementPlus, NProgress };
export { setupSmoothScroll, setupElementPlus, NProgress };

View File

@ -0,0 +1,6 @@
import smoothscroll from 'smoothscroll-polyfill';
/** 平滑滚动插件(兼容主流浏览器) */
export default function setupSmoothScroll() {
smoothscroll.polyfill();
}