Commit a2d764a2 authored by JingChao's avatar JingChao

item聚焦下边框颜色提示

parent 31f8374d
/** /**
* @Author Think * @Author Think
* @Date 2018/11/24 * @Date 2018/11/24
*/ */
<template> <template>
<div :class="{'h-ios': isIos}" class="h-view"> <div :class="{'h-ios': isIos}" class="h-view">
<slot /> <slot/>
</div> </div>
</template> </template>
...@@ -46,35 +46,43 @@ export default { ...@@ -46,35 +46,43 @@ export default {
} }
</script> </script>
<style lang="less" scoped> <style lang="less">
.h-view { ::selection {
width: 100%; background: #3367d6;
height: 100%; color: #fff;
overflow: hidden; }
// padding-bottom: 44px; input:hover ,input:focus{
// background-color: $bgColor; caret-color: #3367d6;
} }
.platform-ios{ .h-view {
.h-view{ width: 100%;
// padding-bottom: 64px; height: 100%;
overflow: hidden;
// padding-bottom: 44px;
// background-color: $bgColor;
} }
}
// iPhoneX适配
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
.platform-ios { .platform-ios {
.h-view { .h-view {
// padding-bottom: 120px; // padding-bottom: 64px;
} }
} }
}
// iPhoneX Max适配 // iPhoneX适配
@media only screen and (device-width: 414px) and (device-height: 896px) { @media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
.platform-ios { .platform-ios {
.h-view { .h-view {
// padding-bottom: 120px; // padding-bottom: 120px;
}
}
}
// iPhoneX Max适配
@media only screen and (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.h-view {
// padding-bottom: 120px;
}
} }
} }
}
</style> </style>
<template> <template>
<div <div
:class="[showActivated,focus]" :class="[showActivated,focus,focusBorder]"
:style="{'min-height':minHeight}" :style="{'min-height':minHeight}"
class="hls-item"> class="hls-item">
<div <div
...@@ -63,11 +63,16 @@ export default { ...@@ -63,11 +63,16 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
showFocusBorder: {
type: Boolean,
default: true,
},
}, },
data () { data () {
return { return {
showActivated: '', showActivated: '',
focus: '', focus: '',
focusBorder: '',
hasTouchEvent: 'ontouchstart' in document, hasTouchEvent: 'ontouchstart' in document,
Icon: require('./right-gray@2x.png'), Icon: require('./right-gray@2x.png'),
} }
...@@ -90,11 +95,16 @@ export default { ...@@ -90,11 +95,16 @@ export default {
// 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为 // 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为
e.preventDefault() e.preventDefault()
}, },
focusin (e) { focusin () {
this.focus = 'focus' let vm = this
vm.focus = 'focus'
if (vm.showFocusBorder) {
vm.focusBorder = 'focus-border'
}
}, },
focusout (e) { focusout () {
this.focus = '' this.focus = ''
this.focusBorder = ''
}, },
start (e) { start (e) {
if (e.target.readOnly) return if (e.target.readOnly) return
...@@ -125,6 +135,14 @@ export default { ...@@ -125,6 +135,14 @@ export default {
&.activated { &.activated {
opacity: 0.8; opacity: 0.8;
} }
&.focus-border{
.contents {
&:after {
border-bottom: 2px solid rgba(0, 65, 196, 1); /*no*/
color: rgba(0, 65, 196, 1);
}
}
}
.contents { .contents {
height: 100%; height: 100%;
......
...@@ -20,7 +20,6 @@ export default { ...@@ -20,7 +20,6 @@ export default {
cusClass: { cusClass: {
type: String, type: String,
default: '', default: '',
}, },
}, },
data () { data () {
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
color: #828282; color: #828282;
} }
.h-header-right .h-header-btn { .h-header-right .h-header-btn {
color: #5D98F6; color: @theme-color;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment