首页 文章

离子iframe - 长按ios时无法粘贴

提问于
浏览
1

长按时iOS无法粘贴但可以复制 .

我搜索如下 .

它不适合我 . 我使用 <iframe> 作为 <ion-content> 子节点 . 复制和粘贴操作都发生在嵌入iframe的html页面上 .

我没有给 src/index.html 添加任何内容 . 我发布 home.htmlhome.scss 一击 .

page-home {

}

.selectable{
    -webkit-user-select: auto;
}

ion-content {
    background: none transparent;
}

iframe {
    background: none transparent;
    -webkit-user-select: auto;
    position: absolute; 
    min-width: 100%; 
    min-height: 100%; 
    z-index: 99;
}
<ion-content scroll="true" overflow-scroll="true" >
  <iframe
      name="mainFrame" id="mainframe"
      src="http://180.168.168.210:8010/mobile/Login.html?"
      class="selectable">
  </iframe>
</ion-content>

而我的离子环境:

cli packages: 
    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:
    Cordova CLI : 7.0.1 

local packages:
    @ionic/app-scripts : 2.0.2
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.5.3

System:
    ios-deploy        : 1.9.1 
    ios-sim           : 5.0.13 
    Node              : v8.4.0
    npm               : 5.3.0 
    OS                : macOS Sierra
    Xcode             : Xcode 8.3.3 Build version 8E3004b

我该怎么办?我很困惑,在哪个文件中设置哪个标签 . 在 src/index.htmliframeion-contention-app

很抱歉提出我的问题,但我真的需要你的帮助!

1 回答

  • 0

    你可以试试这种方式 .

    一定要添加

    ' overflow-scroll: true '到离子含量

    然后你用 class='selectable' 将文本包装在一个div中

    然后你确保将它添加到可选择的类中 .

    -webkit-user-select: auto;
    

    here is working example

    注意:我没有在实际设备上测试过这个 .

    祝好运

相关问题