PrintExample.vue 642 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <h1>EPC发卡</h1>
  3. <button class="btn btn-default" @click="printEpc">打印</button>
  4. <PrintEpc ref="printEpc" printer-name="打印机" />
  5. <h1>打印控件</h1>
  6. <PrintWidget />
  7. </template>
  8. <script>
  9. import PrintEpc from '@/print/print-epc.js';
  10. import PrintWidget from '@/print/print-widget.js';
  11. export default {
  12. components: {
  13. 'PrintEpc': PrintEpc,
  14. 'PrintWidget': PrintWidget,
  15. },
  16. data: function(){
  17. return {
  18. pageSize: 20,
  19. };
  20. },
  21. mounted: function(){
  22. },
  23. methods: {
  24. printEpc: function(){
  25. this.$refs.printEpc.show();
  26. },
  27. },
  28. };
  29. </script>
  30. <style scoped>
  31. </style>