Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
Overview
Overview
Details
Activity
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
zhouqian
vue-gjjs
Commits
fdb6386a
Commit
fdb6386a
authored
Nov 18, 2021
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还原公共组件
parent
50f5f0a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
48 deletions
+31
-48
Select.vue
src/components/Select.vue
+31
-48
No files found.
src/components/Select.vue
View file @
fdb6386a
<
template
>
<el-select
:id=
"id"
v-model=
"model"
v-bind=
"attrs"
v-on=
"$listeners"
v-bind:disabled=
"isDisable"
:clearable=
"clearable"
@
click
.
native=
"handleClick"
>
<el-option
v-for=
"item in code"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
:id=
"id"
v-model=
"model"
v-bind=
"attrs"
v-on=
"$listeners"
v-bind:disabled=
"isDisable"
:clearable=
"clearable"
@
click
.
native=
"handleClick"
>
<slot></slot>
</el-select>
</
template
>
...
...
@@ -23,66 +11,61 @@ export default {
props
:
{
value
:
{
type
:
[
String
,
Array
,
Number
],
default
:
undefined
,
default
:
undefined
},
disabled
:
{
type
:
Boolean
,
default
:
false
,
default
:
false
},
clearable
:
{
type
:
Boolean
,
default
:
true
,
default
:
true
},
id
:
{
type
:
String
,
default
:
undefined
,
},
code
:
{
type
:
Array
,
default
:
function
()
{
return
[];
},
},
default
:
undefined
}
},
computed
:
{
model
:
{
get
()
{
return
this
.
value
;
return
this
.
value
},
set
(
newVal
)
{
this
.
$emit
(
"input"
,
newVal
);
}
,
this
.
$emit
(
'input'
,
newVal
)
}
},
mode
()
{
return
this
.
$store
.
state
.
Status
.
mode
;
return
this
.
$store
.
state
.
Status
.
mode
},
isDisable
:
{
get
()
{
return
this
.
mode
===
"display"
||
this
.
disabled
;
}
,
return
this
.
mode
===
'display'
||
this
.
disabled
}
},
highlight
()
{
return
this
.
$store
.
state
.
Status
.
highlights
.
indexOf
(
this
.
id
)
!==
-
1
;
highlight
()
{
return
this
.
$store
.
state
.
Status
.
highlights
.
indexOf
(
this
.
id
)
!==
-
1
},
attrs
()
{
if
(
this
.
mode
===
"display"
||
this
.
disabled
)
{
let
{
placeholder
,
...
rest
}
=
this
.
$attrs
;
rest
=
{
placeholder
:
" "
,
...
rest
};
return
rest
;
attrs
(){
if
(
this
.
mode
===
'display'
||
this
.
disabled
)
{
let
{
placeholder
,...
rest
}
=
this
.
$attrs
rest
=
{
placeholder
:
" "
,...
rest
}
return
rest
}
return
this
.
$attrs
;
}
,
},
return
this
.
$attrs
}
},
methods
:
{
handleClick
:
function
(
e
)
{
let
ev
=
new
Event
(
"click"
,
{
bubbles
:
true
});
let
node
=
e
.
target
;
let
ev
=
new
Event
(
"click"
,
{
"bubbles"
:
true
})
let
node
=
e
.
target
if
(
node
.
parentElement
)
{
node
.
parentElement
.
dispatchEvent
(
ev
)
;
node
.
parentElement
.
dispatchEvent
(
ev
)
}
}
,
}
,
}
;
}
}
}
</
script
>
<
style
>
...
...
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