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
e639e422
Commit
e639e422
authored
Mar 15, 2021
by
zL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
禁止修改名称可为空
parent
9399a8ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
ModifyTitle.vue
src/components/editTemplate/ModifyTitle.vue
+13
-9
No files found.
src/components/editTemplate/ModifyTitle.vue
View file @
e639e422
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<dialog-input
<dialog-input
class=
"dialog_add-form dialog_add-input_name"
class=
"dialog_add-form dialog_add-input_name"
v-model=
"editTitle"
v-model=
"editTitle"
:errorShowing=
"isErrorShowing"
placeholder=
"请输入标题名称"
placeholder=
"请输入标题名称"
/>
/>
<button
class=
"dialog_add-btn_confirm"
@
click=
"changeEdit"
>
确定
</button>
<button
class=
"dialog_add-btn_confirm"
@
click=
"changeEdit"
>
确定
</button>
...
@@ -12,34 +13,37 @@
...
@@ -12,34 +13,37 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
Property
,
Unit
}
from
"@/plugins/types"
;
import
DialogInput
from
"@/components/DialogInput.vue"
;
import
DialogInput
from
"@/components/DialogInput.vue"
;
export
default
{
export
default
{
// 引入组件
// 引入组件
components
:
{
components
:
{
DialogInput
DialogInput
,
},
},
props
:
[
"selectedEditItem"
],
props
:
[
"selectedEditItem"
],
data
()
{
data
()
{
return
{
return
{
editTitle
:
""
editTitle
:
""
,
isErrorShowing
:
false
,
};
};
},
},
watch
:
{
watch
:
{
selectedEditItem
:
{
selectedEditItem
:
{
handler
(
newName
,
oldName
)
{
handler
(
newName
,
oldName
)
{
if
(
newName
.
title
)
this
.
editTitle
=
newName
.
title
;
if
(
newName
.
title
)
this
.
editTitle
=
newName
.
title
;
if
(
newName
.
label
)
this
.
editTitle
=
newName
.
label
;
if
(
newName
.
label
)
this
.
editTitle
=
newName
.
label
;
},
},
deep
:
true
,
deep
:
true
,
immediate
:
true
immediate
:
true
,
}
}
,
},
},
created
()
{},
created
()
{},
computed
:
{},
computed
:
{},
methods
:
{
methods
:
{
changeEdit
()
{
changeEdit
()
{
if
(
this
.
editTitle
.
trim
()
===
""
)
{
this
.
isErrorShowing
=
true
;
return
;
}
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
this
.
selectedEditItem
)
{
if
(
this
.
selectedEditItem
)
{
if
(
this
.
selectedEditItem
.
hasOwnProperty
(
"title"
))
if
(
this
.
selectedEditItem
.
hasOwnProperty
(
"title"
))
...
@@ -59,13 +63,13 @@ export default {
...
@@ -59,13 +63,13 @@ export default {
)
{
)
{
this
.
$message
({
this
.
$message
({
message
:
"标题不可为空"
,
message
:
"标题不可为空"
,
type
:
"warning"
type
:
"warning"
,
});
});
return
false
;
return
false
;
}
}
this
.
$emit
(
"close"
);
this
.
$emit
(
"close"
);
}
}
,
}
}
,
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
scoped
lang=
"less"
>
...
...
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