elementUI 在移动端使用的一些问题

1、字体顶部被截掉一部分

在部分机型上显示正常,大部分都表现为顶部字体被截掉, 原本的height和line-height都是和font-size一样大,改为:

.info__bus-name {
   font-size: 16px;
   height: 20px;  
   line-height: 20px;
 }

2、ios的问题

2.1 el-select下拉框,要点两次才选中
//解决 element-ui 下拉框在ios上 点击两次才能选中
.el-scrollbar {
  >.el-scrollbar__bar {
    opacity: 1 !important;
  }
}
2.2 点击一个有tooltip的选项,ios出现tooltip的信息,android没有。
<!-- 在tooltip上设置, 在移动端时,不要tooltip -->
 <el-tooltip placement="bottom" :open-delay="1000" :disabled="isMobile">
2.3 点击select,ios出现放大。
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"">
3、 移动端点击出现蓝色半透明背景框
// 安卓
body {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
//IOS
i:focus, a:focus, input:focus, p:focus, div:focus {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  // -webkit-user-modify: read-write-plaintext-only; // 这个会出现输入图标,不需要
}
  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Vue和Element UI中实现移动端禁止截屏和录屏可以通过以下步骤来实现: 1. 阻止截屏:可以通过监听`window`对象的`keyup`、`keydown`和`keypress`事件,当用户按下截屏快捷键时,阻止默认行为。 ```javascript mounted() { window.addEventListener('keyup', this.handleScreenCapture); window.addEventListener('keydown', this.handleScreenCapture); window.addEventListener('keypress', this.handleScreenCapture); }, methods: { handleScreenCapture(event) { if (event.keyCode === 44) { // PrtSc键的keyCode为44 event.preventDefault(); } } }, beforeDestroy() { window.removeEventListener('keyup', this.handleScreenCapture); window.removeEventListener('keydown', this.handleScreenCapture); window.removeEventListener('keypress', this.handleScreenCapture); } ``` 2. 阻止录屏:目前Web端无法直接阻止移动设备上的录屏行为,但可以通过添加一层透明的遮罩层来阻挡录屏软件的截屏功能。在Vue中,可以使用Element UI的`Dialog`组件来实现遮罩层。 ```vue <template> <div> <el-dialog :visible="dialogVisible" :center="true" :modal="false" :show-close="false" :close-on-click-modal="false"> <div class="dialog-content"> <p>禁止录屏</p> </div> </el-dialog> <!-- 页面其他内容 --> </div> </template> <script> export default { data() { return { dialogVisible: true }; } }; </script> <style> .dialog-content { width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.01); } </style> ``` 以上代码中,通过设置`dialogVisible`为`true`,使得`Dialog`组件显示为透明的全屏遮罩层。你可以根据需要自定义遮罩层的样式和内容。 请注意,这种方式只能防止一些常见录屏软件的截屏功能,无法完全阻止所有录屏行为。因为在移动设备上,录屏软件通常会使用系统级别的截屏权限,无法通过前端代码进行完全控制。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值