Print打印
... 2021-7-29 Less than 1 minute
Tips
2.8.6+
<el-button type="primary" @click="handlePrint">打印全部</el-button>
<el-button type="primary" @click="handlePrint1">打印局部</el-button>
<el-button type="primary" @click="handlePrint2">打印DOM</el-button>
<div id="test">
<h2 style="color:red">我是测试字段</h2>
</div>
<script>
export default {
methods: {
handlePrint() {
this.$Print('#app');
},
handlePrint1(){
this.$Print('#test');
},
handlePrint2(){
this.$Print(document.querySelector('.logo'));
}
}
}
</script>
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
id | dom元素的id | String | - | - |
html | html代码片段 | String | - | - |
This app can be installed on your PC or mobile device. This will allow this web app to look and behave like any other installed app. You will find it in your app lists and be able to pin it to your home screen, start menus or task bars. This installed web app will also be able to safely interact with other apps and your operating system.