How to print a part of a vue component without losing the style
问题 I want to print some content from a vue component. For example from the following snippet, I would like to print the v-card-text element which also has an id of #print : new Vue({ el: '#app', data() { return { dialog: false } }, methods: { print() { var prtContent = document.getElementById("print"); var WinPrint = window.open('', '', 'left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus();