DrawLine.vue 626 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <canvas id="CExampleWebGraphDrawLine" width="800" height="200" />
  3. </template>
  4. <script lang="ts">
  5. import {SCanvasView, SPainter} from "@saga-web/draw/lib";
  6. class TestView extends SCanvasView {
  7. constructor() {
  8. super("CExampleWebGraphDrawLine")
  9. }
  10. protected onDraw(canvas: SPainter): void {
  11. // 在此编写绘制操作相关命令
  12. canvas.drawLine(0,0, 200, 200);
  13. }
  14. }
  15. export default {
  16. name: "DrawLine",
  17. mounted() {
  18. console.log(this);
  19. var view = new TestView();
  20. }
  21. }
  22. </script>