Commit 6c8da39d authored by JingChao's avatar JingChao

file

parent c9d4ed65
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
}, },
watch: { watch: {
'showHeight': function () { 'showHeight': function () {
if (detectOS() !== 'ios') { if ($config.isMobilePlatform && detectOS() === 'android') {
if (this.docmHeight >= this.showHeight) { if (this.docmHeight >= this.showHeight) {
// 软键盘弹出的事件处理 // 软键盘弹出的事件处理
let activeElement = document.activeElement let activeElement = document.activeElement
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
this.contentHeight() this.contentHeight()
} }
this.contentsHeight = this.$el.style.height.slice(0, this.$el.style.height.length - 2) this.contentsHeight = this.$el.style.height.slice(0, this.$el.style.height.length - 2)
if (detectOS() === 'ios') { if ($config.isMobilePlatform && detectOS() === 'ios') {
document.body.addEventListener('focusin', () => { document.body.addEventListener('focusin', () => {
// 软键盘弹出的事件处理 // 软键盘弹出的事件处理
......
<template> <template>
<div <div
:class="[showActivated,cusClass]" :class="[showActivated,focus]"
:style="{'min-height':minHeight}" :style="{'min-height':minHeight}"
class="hls-item"> class="hls-item">
<div <div
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
@touchcancel="end" @touchcancel="end"
@mousedown="start" @mousedown="start"
@mouseup="end" @mouseup="end"
@mouseleave="end"> @mouseleave="end"
@focusin="focusin"
@focusout="focusout">
<div v-if="showName" :style="{'min-height':minHeight,'flex':proportion[0] }" class="add-name"> <div v-if="showName" :style="{'min-height':minHeight,'flex':proportion[0] }" class="add-name">
<slot name="left-icon"/> <slot name="left-icon"/>
<slot name="name"/> <slot name="name"/>
...@@ -53,10 +55,6 @@ export default { ...@@ -53,10 +55,6 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
cusClass: {
type: String,
default: '',
},
hasBorder: { hasBorder: {
type: Boolean, type: Boolean,
default: true, default: true,
...@@ -69,6 +67,7 @@ export default { ...@@ -69,6 +67,7 @@ export default {
data () { data () {
return { return {
showActivated: '', showActivated: '',
focus: '',
hasTouchEvent: 'ontouchstart' in document, hasTouchEvent: 'ontouchstart' in document,
Icon: require('./right-gray@2x.png'), Icon: require('./right-gray@2x.png'),
} }
...@@ -91,6 +90,12 @@ export default { ...@@ -91,6 +90,12 @@ export default {
// 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为 // 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为
e.preventDefault() e.preventDefault()
}, },
focusin (e) {
this.focus = 'focus'
},
focusout (e) {
this.focus = ''
},
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
......
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