Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sean King
admin-fe
Commits
d2827bf0
Commit
d2827bf0
authored
7 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
add edit and create demo
parent
e9d37a94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/router/index.js
+4
-2
4 additions, 2 deletions
src/router/index.js
src/views/example/form.vue
+10
-1
10 additions, 1 deletion
src/views/example/form.vue
with
14 additions
and
3 deletions
src/router/index.js
+
4
−
2
View file @
d2827bf0
...
...
@@ -56,7 +56,8 @@ const DynamicTable = () => import('../views/example/table/dynamictable');
const
Table
=
()
=>
import
(
'
../views/example/table/table
'
);
const
DragTable
=
()
=>
import
(
'
../views/example/table/dragTable
'
);
const
InlineEditTable
=
()
=>
import
(
'
../views/example/table/inlineEditTable
'
);
const
Form1
=
()
=>
import
(
'
../views/example/form1
'
);
const
Form
=
()
=>
import
(
'
../views/example/form
'
);
/* permission */
const
Permission
=
()
=>
import
(
'
../views/permission/index
'
);
...
...
@@ -205,7 +206,8 @@ export const asyncRouterMap = [
{
path
:
'
table
'
,
component
:
Table
,
name
:
'
综合table
'
}
]
},
{
path
:
'
form1
'
,
component
:
Form1
,
name
:
'
综合form1
'
}
{
path
:
'
form/edit
'
,
component
:
Form
,
name
:
'
编辑form
'
,
meta
:
{
isEdit
:
true
}
},
{
path
:
'
form/create
'
,
component
:
Form
,
name
:
'
创建form
'
}
]
},
{
path
:
'
*
'
,
redirect
:
'
/404
'
,
hidden
:
true
}
...
...
This diff is collapsed.
Click to expand it.
src/views/example/form
1
.vue
→
src/views/example/form.vue
+
10
−
1
View file @
d2827bf0
...
...
@@ -7,6 +7,9 @@
<div
style=
"display:inline-block"
>
<el-dropdown
trigger=
"click"
>
<router-link
style=
"margin-right:15px;"
v-show=
'isEdit'
:to=
"
{ path:'create'}">
<el-button
type=
"info"
>
创建form
</el-button>
</router-link>
<el-button>
{{
!
postForm
.
comment_disabled
?
'
评论已打开
'
:
'
评论已关闭
'
}}
<i
class=
"el-icon-caret-bottom el-icon--right"
></i></el-button>
<el-dropdown-menu
class=
"no-padding no-hover"
slot=
"dropdown"
>
<el-dropdown-item>
...
...
@@ -185,10 +188,16 @@
computed
:
{
contentShortLength
()
{
return
this
.
postForm
.
content_short
.
length
},
isEdit
()
{
return
this
.
$route
.
meta
.
isEdit
// 根据meta判断
// return this.$route.path.indexOf('edit') !== -1 // 根据路由判断
}
},
created
()
{
this
.
fetchData
();
if
(
this
.
isEdit
)
{
this
.
fetchData
();
}
},
methods
:
{
fetchData
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment