Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
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
JIRA
JIRA
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
黄瑜
VueElementTemplate
Commits
9c2a7e94
Commit
9c2a7e94
authored
Sep 25, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine : format code
parent
fde12e8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
106 deletions
+87
-106
index.vue
src/components/MDinput/index.vue
+87
-106
No files found.
src/components/MDinput/index.vue
View file @
9c2a7e94
...
@@ -2,55 +2,66 @@
...
@@ -2,55 +2,66 @@
<div
class=
"material-input__component"
:class=
"computedClasses"
>
<div
class=
"material-input__component"
:class=
"computedClasses"
>
<div
:class=
"
{iconClass:icon}">
<div
:class=
"
{iconClass:icon}">
<i
class=
"el-input__icon material-input__icon"
:class=
"['el-icon-' + icon]"
v-if=
"icon"
></i>
<i
class=
"el-input__icon material-input__icon"
:class=
"['el-icon-' + icon]"
v-if=
"icon"
></i>
<input
v-if=
"type === 'email'"
type=
"email"
class=
"material-input"
:name=
"name"
<input
v-if=
"type === 'email'"
type=
"email"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:required=
"required"
@
focus=
"handleMdFocus"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'url'"
type=
"url"
class=
"material-input"
:name=
"name"
<input
v-if=
"type === 'url'"
type=
"url"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:placeholder=
"fillPlaceHolder"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:required=
"required"
@
focus=
"handleMdFocus"
v-model=
"currentValue"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'number'"
type=
"number"
class=
"material-input"
:name=
"name"
<input
v-if=
"type === 'number'"
type=
"number"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:step=
"step"
:step=
"step"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:max=
"max"
:min=
"min"
:minlength=
"minlength"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:max=
"max"
:min=
"min"
:maxlength=
"maxlength"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
:minlength=
"minlength"
:maxlength=
"maxlength"
<input
v-if=
"type === 'password'"
type=
"password"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:max=
"max"
:min=
"min"
:required=
"required"
@
focus=
"handleMdFocus"
<input
v-if=
"type === 'password'"
type=
"password"
class=
"material-input"
:name=
"name"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
:placeholder=
"fillPlaceHolder"
<input
v-if=
"type === 'tel'"
type=
"tel"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
v-model=
"currentValue"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:max=
"max"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:required=
"required"
@
focus=
"handleMdFocus"
:min=
"min"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'tel'"
type=
"tel"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'text'"
type=
"text"
class=
"material-input"
:name=
"name"
<input
v-if=
"type === 'text'"
type=
"text"
class=
"material-input"
:name=
"name"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:placeholder=
"fillPlaceHolder"
v-model=
"currentValue"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:minlength=
"minlength"
:maxlength=
"maxlength"
:readonly=
"readonly"
:disabled=
"disabled"
:autoComplete=
"autoComplete"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
:required=
"required"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<span
class=
"material-input-bar"
></span>
<span
class=
"material-input-bar"
></span>
<label
class=
"material-label"
>
<label
class=
"material-label"
>
<slot></slot>
<slot></slot>
</label>
</label>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
// source:https://github.com/wemake-services/vue-material-input/blob/master/src/components/MaterialInput.vue
// source:https://github.com/wemake-services/vue-material-input/blob/master/src/components/MaterialInput.vue
export
default
{
export
default
{
name
:
'md-input'
,
name
:
'md-input'
,
props
:
{
icon
:
String
,
name
:
String
,
type
:
{
type
:
String
,
default
:
'text'
},
value
:
[
String
,
Number
],
placeholder
:
String
,
readonly
:
Boolean
,
disabled
:
Boolean
,
min
:
String
,
max
:
String
,
step
:
String
,
minlength
:
Number
,
maxlength
:
Number
,
required
:
{
type
:
Boolean
,
default
:
true
},
autoComplete
:
{
type
:
String
,
default
:
'off'
},
validateEvent
:
{
type
:
Boolean
,
default
:
true
}
},
computed
:
{
computed
:
{
computedClasses
()
{
computedClasses
()
{
return
{
return
{
...
@@ -77,7 +88,6 @@
...
@@ -77,7 +88,6 @@
}
}
}
}
this
.
$emit
(
'change'
,
value
)
this
.
$emit
(
'change'
,
value
)
// this.handleValidation()
},
},
handleMdFocus
(
event
)
{
handleMdFocus
(
event
)
{
this
.
focus
=
true
this
.
focus
=
true
...
@@ -96,37 +106,8 @@
...
@@ -96,37 +106,8 @@
}
}
}
}
}
}
},
props
:
{
icon
:
String
,
name
:
String
,
type
:
{
type
:
String
,
default
:
'text'
},
value
:
[
String
,
Number
],
placeholder
:
String
,
readonly
:
Boolean
,
disabled
:
Boolean
,
min
:
String
,
max
:
String
,
step
:
String
,
minlength
:
Number
,
maxlength
:
Number
,
required
:
{
type
:
Boolean
,
default
:
true
},
autoComplete
:
{
type
:
String
,
default
:
'off'
},
validateEvent
:
{
type
:
Boolean
,
default
:
true
}
}
}
}
}
</
script
>
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
...
...
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