Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apollo_form_pase
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
web_component
apollo_form_pase
Commits
ad8b26d8
Commit
ad8b26d8
authored
Oct 31, 2019
by
满振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改变淡
parent
3401d54c
Pipeline
#6009
canceled with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
package.json
package.json
+1
-1
index.js
src/index.js
+5
-2
No files found.
package.json
View file @
ad8b26d8
{
{
"name"
:
"apollo_form_pase"
,
"name"
:
"apollo_form_pase"
,
"version"
:
"0.0.
3
"
,
"version"
:
"0.0.
4
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"dist/index.js"
,
"main"
:
"dist/index.js"
,
"module"
:
"dist/index.esm.js"
,
"module"
:
"dist/index.esm.js"
,
...
...
src/index.js
View file @
ad8b26d8
import
{
HandleClass
}
from
'./behavior'
;
import
{
HandleClass
}
from
'./behavior'
;
class
HandleBehavior
{
class
HandleBehavior
{
constructor
(
props
)
{
constructor
(
props
)
{
this
.
formData
=
null
;
this
.
formData
=
props
.
formData
||
null
;
}
}
initBehavior
=
(
formData
)
=>
{
initBehavior
=
(
formData
)
=>
{
if
(
!
this
.
formData
)
{
if
(
!
this
.
formData
)
{
this
.
formData
=
formData
this
.
formData
=
formData
}
}
if
(
!
this
.
formData
)
return
if
(
!
this
.
formData
)
return
this
.
hiddenFilds
();
this
.
formData
.
map
(
item
=>
{
this
.
formData
.
map
(
item
=>
{
if
(
!
item
.
behaviors
||
!
Array
.
isArray
(
item
.
behaviors
)
||
item
.
behaviors
.
length
===
0
)
return
;
if
(
!
item
.
behaviors
||
!
Array
.
isArray
(
item
.
behaviors
)
||
item
.
behaviors
.
length
===
0
)
return
;
const
value
=
this
.
handleFormaterValue
(
item
.
value
,
item
);
const
value
=
this
.
handleFormaterValue
(
item
.
value
,
item
);
...
@@ -16,7 +17,6 @@ class HandleBehavior {
...
@@ -16,7 +17,6 @@ class HandleBehavior {
return
this
;
return
this
;
}
}
getFormData
=
()
=>
{
getFormData
=
()
=>
{
return
this
.
formData
return
this
.
formData
}
}
...
@@ -60,5 +60,8 @@ class HandleBehavior {
...
@@ -60,5 +60,8 @@ class HandleBehavior {
const
componentData
=
this
.
formData
.
find
(
ls
=>
ls
.
name
===
key
)
||
{};
const
componentData
=
this
.
formData
.
find
(
ls
=>
ls
.
name
===
key
)
||
{};
this
.
handleBehavior
({
currentValue
:
value
,
componentData
})
this
.
handleBehavior
({
currentValue
:
value
,
componentData
})
}
}
hiddenFilds
=
()
=>
{
this
.
formData
=
this
.
formData
.
filter
(
item
=>
item
.
type
!==
'hidden'
)
}
}
}
export
default
HandleBehavior
export
default
HandleBehavior
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