DrawPolyline1.vue 689 B

1234567891011121314151617181920212223242526
  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. import { Component, Prop, Vue } from "vue-property-decorator";
  7. class TestView extends SCanvasView {
  8. arr:SPoint[]=[new SPoint(10,10),new SPoint(10,40),new SPoint(30,30)];
  9. constructor() {
  10. super("drawPolyline1")
  11. }
  12. onDraw(canvas: SPainter): void {
  13. canvas.drawPolyline(this.arr);
  14. }
  15. }
  16. @Component
  17. export default class DrawPolyline1 extends Vue {
  18. mounted(): void {
  19. new TestView();
  20. }
  21. }
  22. </script>