• 打印选中的网页


     //把需要打印的代码,替换掉body中的内容,执行window.print()方法
    document.getElementsByTagName("body")[0].style.overflow='auto' // this.$print(this.$refs.print) var arr=document.getElementsByClassName('v-transfer-dom') arr.forEach(function(item){ item.style.display='none' }) var tables=document.getElementsByTagName('table'); tables.forEach(function(item){ item.style.width='100%' item.setAttribute('width','100%'); }) var td=document.getElementsByTagName('td'); td.forEach(function(item){ item.style.width='auto' item.setAttribute('width','auto'); }) setTimeout(function(){ document.getElementById('app1').innerHTML="" document.getElementById('app1').appendChild((document.getElementById('print').cloneNode(true))) window.print(); window.location.reload(); })
  • 相关阅读:
    画板
    多线程
    Runtime
    今日头条UI搭建
    支付宝UI界面搭建
    控制器的创建
    UIWindow简单介绍
    UIApplication
    UIPickerView的使用
    代理、通知、KVO
  • 原文地址:https://www.cnblogs.com/liuhao-web/p/12858090.html
Copyright © 2020-2023  润新知