Screenshot 屏幕截图
... 2021-7-29 Less than 1 minute
# Screenshot 屏幕截图
Tips
2.1.1+
<!-- 导入需要的包 (一定要放到index.html中的head标签里)-->
<script src="https://cdn.staticfile.net/html2canvas/0.5.0-beta4/html2canvas.min.js"></script>
1
2
2
Copy
Tips
2.1.1+
<!-- 导入需要的包 (一定要放到index.html中的head标签里)-->
<script src="https://cdn.staticfile.net/html2canvas/0.5.0-beta4/html2canvas.min.js"></script>
<el-button @click="handleOk"
type="primary"
icon="el-icon-camera"
>意见反馈</el-button>
<el-dialog modal-append-to-body
append-to-body
title="意见反馈"
top="50px"
:visible.sync="box"
width="60%">
<el-input type="textarea"
placeholder="请告诉我们遇到的问题或建议"
v-model="form.text"></el-input>
<br />
<br />
<div v-loading="flag"
element-loading-text="正在截取屏幕数据">
<img :src="form.img"
width="100%" />
</div>
<span slot="footer" >
<el-button type="primary"
icon="el-icon-check"
@click="handleSubmit">提 交</el-button>
</span>
</el-dialog>
<script>
export default {
data () {
return {
box: false,
form: {
img: '',
text: ''
}
}
},
computed: {
flag () {
return this.form.img;
}
},
methods: {
handleOk () {
this.form = {
img: '',
text: ''
}
this.$Screenshot(document.querySelector("#app")).then(canvas => {
this.form.img = canvas.toDataURL("image/jpeg", 0.8);
});
this.box = true;
}
}
}
</script>
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.