Commit 7f91df80 authored by JingChao's avatar JingChao

field组件

parent 8cb8f354
<template> <template>
<div <div
:class="[showActivated,focus,focusBorder]" :class="[showActivated,cusClass]"
:style="{'min-height':minHeight}" :style="{'min-height':minHeight}"
class="hls-item"> class="hls-item">
<div <div
...@@ -11,22 +11,15 @@ ...@@ -11,22 +11,15 @@
@touchcancel="end" @touchcancel="end"
@mousedown="start" @mousedown="start"
@mouseup="end" @mouseup="end"
<<<<<<< HEAD
@mouseleave="end"
@focusin="focusin"
@focusout="focusout">
<div v-if="showName" :style="{'min-height':minHeight,'flex':proportion[0] }" class="add-name">
=======
@mouseleave="end"> @mouseleave="end">
<div v-if="showName && hasName" :style="{'min-height':minHeight,'flex':proportion[0] }" class="add-name"> <div v-if="showName && hasName" :style="{'min-height':minHeight,'flex':proportion[0] }" class="add-name">
>>>>>>> develop
<slot name="left-icon"/> <slot name="left-icon"/>
<slot name="name"/> <slot name="name"/>
</div> </div>
<div v-if="showContent && hasContent" :style="{'min-height':minHeight,'flex':proportion[1] }" class="add-content"> <div v-if="showContent && hasContent" :style="{'min-height':minHeight,'flex':proportion[1] }" class="add-content">
<slot name="content"/> <slot name="content"/>
<slot name="right-icon"/> <slot name="right-icon"/>
<img v-if="showArrow" :src="rightIcon" class="right-icon"> <img v-if="showArrow" :src="rightIcon" class="right-icon" style="height: 0.2rem">
</div> </div>
<slot/> <slot/>
</div> </div>
...@@ -60,6 +53,10 @@ export default { ...@@ -60,6 +53,10 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
cusClass: {
type: String,
default: '',
},
hasBorder: { hasBorder: {
type: Boolean, type: Boolean,
default: true, default: true,
...@@ -68,16 +65,10 @@ export default { ...@@ -68,16 +65,10 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
showFocusBorder: {
type: Boolean,
default: false,
},
}, },
data () { data () {
return { return {
showActivated: '', showActivated: '',
focus: '',
focusBorder: '',
hasTouchEvent: 'ontouchstart' in document, hasTouchEvent: 'ontouchstart' in document,
Icon: require('./right-gray@2x.png'), Icon: require('./right-gray@2x.png'),
} }
...@@ -106,18 +97,6 @@ export default { ...@@ -106,18 +97,6 @@ export default {
// 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为 // 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为
e.preventDefault() e.preventDefault()
}, },
focusin () {
let vm = this
let showFocus = vm.showFocusBorder ? vm.showFocusBorder : vm.$parent.showFocusBorder
vm.focus = 'focus'
if (showFocus) {
vm.focusBorder = 'focus-border'
}
},
focusout () {
this.focus = ''
this.focusBorder = ''
},
start (e) { start (e) {
if (e.target.readOnly) return if (e.target.readOnly) return
if (e.target.nodeName === 'INPUT' || e.target.nodeName === 'TEXTAREA' || e.target.nodeName === 'BUTTON' || e.target.nodeName === 'LABEL') return if (e.target.nodeName === 'INPUT' || e.target.nodeName === 'TEXTAREA' || e.target.nodeName === 'BUTTON' || e.target.nodeName === 'LABEL') return
...@@ -136,6 +115,7 @@ export default { ...@@ -136,6 +115,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import "../../common/styles/variables";
.hls-item { .hls-item {
//height: 100px; //height: 100px;
width: 100%; width: 100%;
...@@ -146,14 +126,6 @@ export default { ...@@ -146,14 +126,6 @@ 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%;
...@@ -235,7 +207,6 @@ export default { ...@@ -235,7 +207,6 @@ export default {
//右侧图标 //右侧图标
.right-icon { .right-icon {
margin-left: 5px; margin-left: 5px;
height: 0.2rem;
} }
//toggle //toggle
......
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