DrawPolyline1.vue 484 B

123456789101112131415161718192021222324
  1. <template>
  2. <canvas id="drawPolyline1" width="800" height="100" />
  3. </template>
  4. <script lang="ts">
  5. import { SCanvasView, SColor, SPainter } from "@saga-web/draw/lib";
  6. class TestView extends SCanvasView {
  7. constructor() {
  8. super("drawPolyline1")
  9. }
  10. onDraw(canvas: SPainter): void {
  11. canvas.drawLine(0,0, 100, 100);
  12. }
  13. }
  14. export default {
  15. mounted() {
  16. new TestView();
  17. }
  18. }
  19. </script>