提交 8f9eff78 作者: vben

style: update back-top style

上级 dddda5b2
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
- 移除左侧菜单搜索,新增顶部菜单搜索功能 - 移除左侧菜单搜索,新增顶部菜单搜索功能
### 🎫 Chores
- 返回顶部样式调整,避免遮住其他元素
## 2.0.0-rc.13 (2020-12-10) ## 2.0.0-rc.13 (2020-12-10)
## (破坏性更新) Breaking changes ## (破坏性更新) Breaking changes
......
import ClickOutSide from './src/index.vue';
import { withInstall } from '../util'; import { withInstall } from '../util';
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
withInstall(ClickOutSide); export const ClickOutSide = createAsyncComponent(() => import('./src/index.vue'));
export { ClickOutSide }; withInstall(ClickOutSide);
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
width: 100%; width: 100%;
} }
.ant-back-top {
right: 20px;
bottom: 20px;
}
.collapse-container__body { .collapse-container__body {
> .ant-descriptions { > .ant-descriptions {
margin-left: 6px; margin-left: 6px;
......
...@@ -6,7 +6,7 @@ import { createRouter, createWebHashHistory } from 'vue-router'; ...@@ -6,7 +6,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
import { createGuard } from './guard/'; import { createGuard } from './guard/';
import { basicRoutes } from './routes/'; import { basicRoutes } from './routes/';
import { scrollBehavior } from './scrollBehaviour'; import { scrollBehavior } from './scrollBehavior';
export const hashRouter = createWebHashHistory(); export const hashRouter = createWebHashHistory();
......
import { defineAsyncComponent } from 'vue'; import { defineAsyncComponent } from 'vue';
import { Spin } from 'ant-design-vue'; import { Spin } from 'ant-design-vue';
import { noop } from '/@/utils/index';
interface Options {
size?: 'default' | 'small' | 'large';
delay?: number;
timeout?: number;
loading?: boolean;
retry?: boolean;
}
export function createAsyncComponent(loader: any) { export function createAsyncComponent(loader: Fn, options: Options = {}) {
const { size = 'small', delay = 100, timeout = 3000, loading = true, retry = true } = options;
return defineAsyncComponent({ return defineAsyncComponent({
loader: loader, loader,
loadingComponent: <Spin spinning={true} />, loadingComponent: loading ? <Spin spinning={true} size={size} /> : undefined,
// The error component will be displayed if a timeout is // The error component will be displayed if a timeout is
// provided and exceeded. Default: Infinity. // provided and exceeded. Default: Infinity.
timeout: 3000, timeout,
// Defining if component is suspensible. Default: true. // Defining if component is suspensible. Default: true.
// suspensible: false, // suspensible: false,
delay: 100, delay,
/** /**
* *
* @param {*} error Error message object * @param {*} error Error message object
...@@ -18,7 +27,9 @@ export function createAsyncComponent(loader: any) { ...@@ -18,7 +27,9 @@ export function createAsyncComponent(loader: any) {
* @param {*} fail End of failure * @param {*} fail End of failure
* @param {*} attempts Maximum allowed retries number * @param {*} attempts Maximum allowed retries number
*/ */
onError(error, retry, fail, attempts) { onError: !retry
? noop
: (error, retry, fail, attempts) => {
if (error.message.match(/fetch/) && attempts <= 3) { if (error.message.match(/fetch/) && attempts <= 3) {
// retry on fetch errors, 3 max attempts // retry on fetch errors, 3 max attempts
retry(); retry();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论