Browse Source

Merge remote-tracking branch 'origin/master'

张维新 4 years ago
parent
commit
eb87ab0665

+ 0 - 27
docs/.vuepress/components/DrawLine.vue

@@ -1,27 +0,0 @@
-<template>
-    <canvas id="CExampleWebGraphDrawLine" width="800" height="200" />
-</template>
-
-<script lang="ts">
-    import {SCanvasView, SPainter} from "@saga-web/draw/lib";
-
-    class TestView extends SCanvasView {
-
-        constructor() {
-            super("CExampleWebGraphDrawLine")
-        }
-
-        protected onDraw(canvas: SPainter): void {
-            // 在此编写绘制操作相关命令
-            canvas.drawLine(0,0, 200, 200);
-        }
-    }
-
-    export default {
-        name: "DrawLine",
-        mounted() {
-            console.log(this);
-            var view = new TestView();
-        }
-    }
-</script>

+ 25 - 0
docs/.vuepress/components/example/web/graph/DrawLine1.vue

@@ -0,0 +1,25 @@
+<template>
+    <canvas id="DrawLine1" width="800" height="200" />
+</template>
+
+<script lang="ts">
+    import { SCanvasView, SPainter } from "@saga-web/draw/lib";
+
+    class TestView extends SCanvasView {
+
+        constructor() {
+            super("DrawLine1")
+        }
+
+        onDraw(canvas: SPainter): void {
+            // 在此编写绘制操作相关命令
+            canvas.drawLine(0,0, 200, 200);
+        }
+    }
+
+    export default {
+        mounted() {
+            new TestView();
+        }
+    }
+</script>

+ 14 - 0
docs/.vuepress/enhanceApp.js

@@ -0,0 +1,14 @@
+// .vuepress/enhanceApp.js
+// 全局注册 Element 组件库
+
+import Vue from 'vue'
+import Element from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css'
+
+export default ({
+        Vue,
+        options,
+        router
+    }) => {
+    Vue.use(Element)
+}

+ 6 - 2
docs/dev/saga-graphy/graphy-engine/draw.md

@@ -5,9 +5,13 @@
 
 ## 直线
 
-<DrawLine /> 
+<example-web-graph-DrawLine1 /> 
 
-<<< @/docs/.vuepress/components/DrawLine.vue
+::: details 查看代码
+
+<<< @/docs/.vuepress/components/example/web/graph/DrawLine1.vue
+
+:::
 
 ## 折线