Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
hujun
tl_estate
Commits
e3fe35d5
Commit
e3fe35d5
authored
Jul 31, 2019
by
duxinyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义开关组建
parent
397d082a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
switch.vue
public/appnew/src/components/publicEg/switch.vue
+65
-0
No files found.
public/appnew/src/components/publicEg/switch.vue
0 → 100644
View file @
e3fe35d5
<
template
>
<div>
<div
class=
"left"
@
click=
"choose(0)"
:style=
"
{'background-color' : choosed ? ( selected ? '#FF8018' : '#f7f7f7' ) : '#f7f7f7','color' :choosed ? ( selected ? '#f7f7f7' : '#FF8018' ) : '#FF8018'} ">
{{
data
.
str1
}}
</div>
<div
class=
"right"
@
click=
"choose(1)"
:style=
"
{'background-color' : choosed ? ( selected ? '#f7f7f7' : '#FF8018' ) : '#f7f7f7','color' :choosed ? ( selected ? '#FF8018' : '#f7f7f7' ) : '#FF8018'}">
{{
data
.
str2
}}
<!--
<div
style=
"width:.3rem; height:.3rem; border-radius : 50% ; background-color : red ;overflow:hidden ;margin:.1rem .1rem .1rem .1rem;float:right;"
></div>
-->
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
data
:
{
type
:
Object
,
default
:
{
'str1'
:
'是'
,
'str2'
:
'否'
}
}
},
data
:
()
=>
({
selected
:
false
,
choosed
:
false
,
}),
methods
:
{
choose
:
function
(
status
){
let
that
=
this
;
console
.
log
(
"123"
)
that
.
choosed
=
true
;
that
.
selected
=
status
==
0
?
true
:
false
;
this
.
$emit
(
'swithchBack'
,
that
.
selected
?
0
:
1
)
},
},
}
</
script
>
<
style
scoped
>
.left
{
padding
:
0rem
.22rem
;
;
height
:
.5rem
;
border-radius
:
.1rem
0rem
0rem
.1rem
;
float
:
left
;
line-height
:
.5rem
;
text-align
:
center
;
font-size
:
.23rem
;
line-height
:
.55rem
;
}
.right
{
margin-left
:
1px
;
padding
:
0rem
.22rem
;
;
height
:
.5rem
;
border-radius
:
0rem
.1rem
.1rem
0rem
;
float
:
left
;
line-height
:
.5rem
;
text-align
:
center
;
font-size
:
.23rem
;
line-height
:
.55rem
;
}
</
style
>
\ No newline at end of file
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