Commit 6c8da39d authored by JingChao's avatar JingChao

file

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