DrawPolyline1.vue 568 B

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