Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tinyu5
vue2-tools
提交
e2bedc74
V
vue2-tools
项目概览
Tinyu5
/
vue2-tools
与 Fork 源项目一致
Fork自
inscode / VueJS
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue2-tools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e2bedc74
编写于
3月 28, 2024
作者:
T
tinyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:配置过渡动画,加载进度条
上级
e257ff2c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
80 addition
and
17 deletion
+80
-17
babel.config.js
babel.config.js
+1
-0
package.json
package.json
+2
-2
src/components/layout/dynamicRoute.vue
src/components/layout/dynamicRoute.vue
+57
-13
src/router/index.js
src/router/index.js
+15
-2
yarn.lock
yarn.lock
+5
-0
未找到文件。
babel.config.js
浏览文件 @
e2bedc74
module
.
exports
=
{
compact
:
false
,
presets
:
[
'
@vue/cli-plugin-babel/preset
'
]
...
...
package.json
浏览文件 @
e2bedc74
...
...
@@ -12,6 +12,7 @@
"
echarts
"
:
"
^5.5.0
"
,
"
element-ui
"
:
"
^2.15.14
"
,
"
moment
"
:
"
^2.30.1
"
,
"
nprogress
"
:
"
^0.2.0
"
,
"
vue
"
:
"
^2.6.14
"
,
"
vue-router
"
:
"
3
"
},
...
...
@@ -43,7 +44,6 @@
},
"browserslist"
:
[
"> 1%"
,
"last 2 versions"
,
"not dead"
"last 2 versions"
]
}
src/components/layout/dynamicRoute.vue
浏览文件 @
e2bedc74
<
template
>
<
div
>
<
transition
name=
"fade"
mode=
"out-in"
>
<router-view></router-view>
</
div
>
</
transition
>
</
template
>
<
script
>
export
default
{
name
:
'
DynamicRoute
'
,
data
()
{
return
{
export
default
{
name
:
'
DynamicRoute
'
,
data
()
{
return
{
}
},
}
},
mounted
()
{
mounted
()
{
},
},
methods
:
{
methods
:
{
},
},
}
}
</
script
>
<
style
scoped
>
.wrapper
{
width
:
100%
;
min-height
:
100vh
;
}
.slide-enter-active
,
.slide-leave-active
{
transition
:
all
0.75s
ease-out
;
}
.slide-enter-to
{
position
:
absolute
;
right
:
0
;
}
.slide-enter-from
{
position
:
absolute
;
right
:
-100%
;
}
.fade-enter-active
,
.fade-leave-active
{
transition
:
opacity
0.5s
ease
;
}
.fade-enter-from
,
.fade-leave-to
{
opacity
:
0
;
}
.slide-leave-to
{
position
:
absolute
;
left
:
-100%
;
}
.slide-leave-from
{
position
:
absolute
;
left
:
0
;
}
</
style
>
\ No newline at end of file
src/router/index.js
浏览文件 @
e2bedc74
import
Vue
from
'
vue
'
;
import
VueRouter
from
"
vue-router
"
//引入nprogress 进度条插件
import
NProgress
from
'
nprogress
'
import
'
nprogress/nprogress.css
'
import
routes
from
'
./routes
'
import
nProgress
from
'
nprogress
'
;
Vue
.
use
(
VueRouter
)
export
default
new
VueRouter
({
const
router
=
new
VueRouter
({
mode
:
'
history
'
,
routes
})
\ No newline at end of file
})
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
NProgress
.
start
()
next
()
})
router
.
afterEach
(()
=>
{
NProgress
.
done
()
})
export
default
router
;
\ No newline at end of file
yarn.lock
浏览文件 @
e2bedc74
...
...
@@ -4702,6 +4702,11 @@ npm-run-path@^4.0.1:
dependencies:
path-key "^3.0.0"
nprogress@^0.2.0:
version "0.2.0"
resolved "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==
nth-check@^2.0.1:
version "2.1.1"
resolved "http://mirrors.csdn.net.cn/repository/csdn-npm-mirrors/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录