1.如果点了layout部分,mian部分的内容都需要点两次
解决办法:
第一步:
<style lang="scss">
.el-scrollbar {
.el-scrollbar__bar {
opacity: 1 !important;
}
}
</style>
第二步:
import FastClick from './fastclick.js'
mounted:--------------------------------= =
// 监听 touch 事件来判断触发元素是否为 input
document.addEventListener('touchstart', function(e) {
const targetElement = e.target
// 如果触发元素是 input,则使用 FastClick
if (targetElement.tagName.toLowerCase() === 'input') {
FastClick.attach(targetElement)
}
}, true)
第一步解决select的问题,第二步解决input如果有值也需要点两次的问题
2.el-table如果加了tooltip的话,ipad的拖拽并不会触发tooltip的消失,解决办法如下
mounted() {
window.addEventListener('touchstart', this.handleTouchStart, false)
},
beforeDestroy() { // 实例销毁之前对点击事件进行解绑
window.removeEventListener('touchstart', this.handleTouchStart)
},
methods: {
openDetails() {
const list = document.getElementsByClassName('el-tooltip__popper')
if (list.length > 0) {
list[list.length - 1].style.display = ''
}
},
handleTouchStart() {
const list = document.getElementsByClassName('el-tooltip__popper')
if (list.length > 0) {
list[list.length - 1].style.display = 'none' }
},
}
<el-table ref="articleList"
v-loading="loading"
:data="articleListTable"
width="600px"
border
:height="tableHeight"
:header-cell-style="{
background: theme,
color: '#fff',
'text-align': 'center'
}"
class="table-article"
:row-style="{ height: '36px' }"
:cell-style="cellStyle"
@header-dragend="handleDragend"
@row-click="openDetails"
>
加上row-click,每次点击的时候都会触发这个方法,拖拽就隐藏,点击的如果是同一样就把隐藏样式删除
3.select点击的时候出现阴影(例如侧边栏或者select下拉框)
/* ------------ios端------------ */
* {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
}
/* ------------Android端------------ */
select {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
border: none;
}
注:别写在scope里面==