Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
source-trace-manage-go
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tracing
source-trace-manage-go
Commits
20f6def6
Commit
20f6def6
authored
Mar 11, 2021
by
zL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改路由跳转导致的侧边导航栏不刷新的问题
parent
2ba2ee83
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
28 deletions
+45
-28
MainMenu.vue
src/components/MainMenu/MainMenu.vue
+13
-10
Uncertified.vue
src/components/Uncertified.vue
+15
-11
Index.vue
src/components/category/Index.vue
+0
-1
actions.ts
src/store/actions.ts
+9
-3
getters.ts
src/store/getters.ts
+1
-0
mutations.ts
src/store/mutations.ts
+3
-1
state.ts
src/store/state.ts
+2
-1
types.ts
src/store/types.ts
+2
-1
No files found.
src/components/MainMenu/MainMenu.vue
View file @
20f6def6
...
...
@@ -4,7 +4,7 @@
<div
class=
"menu-item menu-item_first"
:class=
"
{ 'js-menu-item_active': currentRoute === 0 }"
@click="selectPage(0, 'categoryManage')"
@click="selectPage(0, '
/
categoryManage')"
>
<div
class=
"menu-item_subject-icon"
>
<i
class=
"iconfont"
>

</i>
...
...
@@ -26,7 +26,7 @@
<div
class=
"menu-item menu-item_template"
:class=
"
{ 'js-menu-item_active': currentRoute === 2 }"
@click="selectPage(2, 'userCenter')"
@click="selectPage(2, '
/
userCenter')"
>
<div
class=
"menu-item_template-icon"
>
<i
class=
"iconfont"
>

</i>
...
...
@@ -40,22 +40,25 @@
<
script
>
let
UrlPrefixObj
=
require
(
"@/config/UrlPrefix"
);
export
default
{
data
()
{
return
{
currentRoute
:
Number
(
sessionStorage
.
getItem
(
"currentRoute"
)),
}
;
computed
:
{
currentRoute
()
{
return
this
.
$store
.
getters
.
get_currentRoute
;
}
,
},
mounted
()
{},
methods
:
{
// 路由切换
selectPage
(
idnex
,
path
)
{
this
.
$store
.
dispatch
(
"selectPage"
,
idnex
)
.
then
(()
=>
{
if
(
idnex
===
1
)
{
window
.
open
(
UrlPrefixObj
.
model
.
CHAIN_BROWSER_URL_PREFIX
);
}
else
{
if
(
this
.
currentRoute
===
idnex
)
return
;
sessionStorage
.
setItem
(
"currentRoute"
,
idnex
);
this
.
currentRoute
=
idnex
;
if
(
this
.
$route
.
path
===
path
)
return
;
this
.
$router
.
push
({
path
:
path
});
}
})
.
catch
(()
=>
{});
},
},
};
...
...
src/components/Uncertified.vue
View file @
20f6def6
...
...
@@ -12,25 +12,29 @@
<button
class=
"g-btn_primary btn_confirm"
@
click=
"$emit('confirm')"
>
取消
</button>
<button
class=
"g-btn_primary btn_cancel"
@
click=
"$emit('cancel')"
>
去认证
</button>
<button
class=
"g-btn_primary btn_cancel"
@
click=
"cancel"
>
去认证
</button>
</div>
</div>
</common-dialog>
</
template
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
}
from
"vue-property-decorator"
;
<
script
>
import
CommonDialog
from
"@/components/CommonDialog.vue"
;
@
Component
(
{
export
default
{
components
:
{
CommonDialog
,
},
})
export
default
class
Uncertified
extends
Vue
{
@
Prop
()
tip
!
:
string
;
}
methods
:
{
cancel
()
{
this
.
$store
.
dispatch
(
"selectPage"
,
2
)
.
then
(()
=>
{
this
.
$emit
(
"cancel"
);
})
.
catch
(()
=>
{});
},
},
};
</
script
>
<
style
scoped
>
...
...
@@ -42,7 +46,7 @@ export default class Uncertified extends Vue {
.g-btn_primary
{
border
:
none
;
background
:
#5779F
4
;
background
:
#5779f
4
;
font-size
:
14px
;
color
:
#fff
;
outline
:
none
;
...
...
src/components/category/Index.vue
View file @
20f6def6
...
...
@@ -69,7 +69,6 @@
</
template
>
<
script
lang=
"ts"
>
import
{
GO_URLS
}
from
"@/config/URLS"
;
import
{
Component
,
Vue
,
Watch
}
from
"vue-property-decorator"
;
// 模板管理部分
import
TemplateManage
from
"./TemplateManage.vue"
;
...
...
src/store/actions.ts
View file @
20f6def6
import
{
StateTypes
}
from
"./types"
;
import
{
ActionTree
}
from
"vuex"
;
import
{
StateTypes
}
from
"./types"
;
import
{
ActionTree
}
from
"vuex"
;
const
actions
:
ActionTree
<
StateTypes
,
any
>
=
{
selectPage
({
commit
},
idnex
)
{
return
new
Promise
<
void
>
((
resolve
)
=>
{
sessionStorage
.
setItem
(
"currentRoute"
,
idnex
);
commit
(
'setCurrentRoute'
,
idnex
)
resolve
()
})
},
};
export
default
actions
;
src/store/getters.ts
View file @
20f6def6
...
...
@@ -4,6 +4,7 @@ import { GetterTree } from "vuex";
const
getters
:
GetterTree
<
StateTypes
,
any
>
=
{
get_templateType
:
state
=>
state
.
templateType
,
get_templateData
:
state
=>
state
.
templateData
,
get_currentRoute
:
state
=>
state
.
currentRoute
,
};
export
default
getters
;
src/store/mutations.ts
View file @
20f6def6
...
...
@@ -57,7 +57,9 @@ const mutations: MutationTree<StateTypes> = {
setTemplateData
(
state
,
data
)
{
state
.
templateData
=
data
},
// templateData
setCurrentRoute
:
(
state
,
currentRoute
)
=>
{
state
.
currentRoute
=
currentRoute
},
};
export
default
mutations
;
src/store/state.ts
View file @
20f6def6
...
...
@@ -16,7 +16,8 @@ const state: StateTypes = {
theAnchor
:
-
1
,
chainStatus
:
''
,
templateType
:
0
,
templateData
:
{}
templateData
:
{},
currentRoute
:
Number
(
sessionStorage
.
getItem
(
"currentRoute"
))
||
0
};
export
default
state
;
src/store/types.ts
View file @
20f6def6
...
...
@@ -15,6 +15,7 @@ export interface StateTypes {
theAnchor
:
number
,
//用于记录增量列表的展开
chainStatus
:
string
,
templateType
:
number
,
templateData
:
any
templateData
:
any
,
currentRoute
:
number
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment