Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
3753f193
Unverified
Commit
3753f193
authored
Sep 13, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testing form validation
parent
5be5c852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
23 deletions
+6
-23
PageForm.vue
Modules/Page/Assets/js/components/PageForm.vue
+6
-23
No files found.
Modules/Page/Assets/js/components/PageForm.vue
View file @
3753f193
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
<div
class=
"box-body"
>
<div
class=
"box-body"
>
<el-tabs
type=
"card"
>
<el-tabs
type=
"card"
>
<el-tab-pane
:label=
"localeArray.name"
v-for=
"(localeArray, locale) in locales"
:key=
"localeArray.name"
>
<el-tab-pane
:label=
"localeArray.name"
v-for=
"(localeArray, locale) in locales"
:key=
"localeArray.name"
>
<el-form-item
:label=
"translate('page', 'title')"
<el-form-item
:label=
"translate('page', 'title')"
class=
"el-form-item is-error
"
>
:class=
"
{'el-form-item is-error': form.errors.has('en.title') }
">
<el-input
v-model=
"page[locale].title"
@
change=
"slugifyTitle($event, locale)"
></el-input>
<el-input
v-model=
"page[locale].title"
@
change=
"slugifyTitle($event, locale)"
></el-input>
<div
class=
"el-form-item__error"
>
Please input Activity name
</div>
<div
class=
"el-form-item__error"
v-if=
"form.errors.has('en.title')"
v-text=
"form.errors.first('en.title')"
>
</div>
</el-form-item>
</el-form-item>
<el-form-item
:label=
"translate('page', 'slug')"
>
<el-form-item
:label=
"translate('page', 'slug')"
>
<el-input
v-model=
"page[locale].slug"
></el-input>
<el-input
v-model=
"page[locale].slug"
></el-input>
...
@@ -129,30 +129,13 @@
...
@@ -129,30 +129,13 @@
'
index
'
:
'
index
'
,
'
index
'
:
'
index
'
,
'
home
'
:
'
home
'
,
'
home
'
:
'
home
'
,
},
},
errors
:
''
,
form
:
new
Form
()
,
}
}
},
},
methods
:
{
methods
:
{
onSubmit
()
{
onSubmit
()
{
let
vm
=
this
;
this
.
form
=
new
Form
(
this
.
page
);
const
form
=
new
Form
(
this
.
page
);
this
.
form
.
post
(
route
(
'
api.page.page.store
'
));
form
.
post
(
route
(
'
api.page.page.store
'
))
.
then
(
response
=>
{
})
.
catch
(
errors
=>
{
console
.
log
(
errors
.
response
.
data
.
errors
);
vm
.
errors
=
errors
.
response
.
data
.
errors
;
});
// axios.post(route('api.page.page.store'), this.page)
// .then(response => {
// console.log(response);
// })
// .catch(response => {
// console.log(response.response.data);
// this.errors = response.response.data;
// })
},
},
setPageTypes
()
{
setPageTypes
()
{
axios
.
get
(
route
(
'
api.page.page-templates.index
'
))
axios
.
get
(
route
(
'
api.page.page-templates.index
'
))
...
...
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