File tree Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -1841,7 +1841,6 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
1841
1841
} else {
1842
1842
this . path = defview
1843
1843
}
1844
- this . handleHistory ( this . path )
1845
1844
// 监听浏览器后退事件
1846
1845
window . addEventListener ( 'popstate' , ( e ) => ( this . path = e . state . url ) , false )
1847
1846
// 如果后端没有渲染数据, 则发出请求获取数据
@@ -1909,23 +1908,18 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
1909
1908
this . ui . isWaitToggleSearchBar = false
1910
1909
} , 1000 ) ,
1911
1910
handleHistory ( path ) {
1912
- const state = { title : 'BoxJs' , url : path }
1911
+ const { hash } = window . location . href ;
1912
+ const state = { title : 'BoxJs' , url : '/' + ( hash ? hash : '#/' ) }
1913
1913
if ( ! history . state ) {
1914
1914
history . replaceState ( state , '' )
1915
1915
}
1916
+
1917
+ state . url = path ;
1916
1918
history . pushState ( state , '' , path )
1917
1919
} ,
1918
1920
// 页面返回
1919
1921
back ( ) {
1920
- if ( this . view === 'bak' && ! this . bfpath ) {
1921
- this . path = '/#/my'
1922
- this . handleHistory ( this . path )
1923
- } else if ( this . view === 'app' && ! this . bfpath ) {
1924
- this . path = '/#/app'
1925
- this . handleHistory ( this . path )
1926
- } else {
1927
- history . back ( )
1928
- }
1922
+ history . back ( )
1929
1923
} ,
1930
1924
// 切换当前容器环境
1931
1925
switchEnv ( env ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
3
3
// 为 eval 准备的上下文环境
4
4
const $eval_env = { }
5
5
6
- $ . version = '0.7.49 '
6
+ $ . version = '0.7.50 '
7
7
$ . versionType = 'beta'
8
8
9
9
/**
Original file line number Diff line number Diff line change 1
1
{
2
2
"releases" : [
3
+ {
4
+ "version" : " 0.7.50" ,
5
+ "tags" : [" beta" ],
6
+ "author" : " @id77" ,
7
+ "icon" : " https://avatars3.githubusercontent.com/u/29748519" ,
8
+ "repo" : " https://github.com/chavyleung" ,
9
+ "msg" : " 更新[BoxJs TF]: 优化页面后退事件逻辑" ,
10
+ "notes" : [
11
+ {
12
+ "name" : " 优化" ,
13
+ "descs" : [" 页面后退事件逻辑" ]
14
+ }
15
+ ]
16
+ },
3
17
{
4
18
"version" : " 0.7.49" ,
5
19
"tags" : [" beta" ],
You can’t perform that action at this time.
0 commit comments