Browse Source

增加typescript支持。

sybotan 4 years ago
parent
commit
c492f8ab26

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

@@ -0,0 +1,27 @@
+<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>

+ 11 - 2
docs/.vuepress/config.js

@@ -10,8 +10,17 @@ module.exports = {
     title: "数字化交付开发文档",
     description: "上格云数字化交付开发文档",
     base: "/doc/",
-    // plugins: ["@vuepress/last-updated"],
-    plugins: ['@vuepress/back-to-top'],
+    plugins: [
+        "@vuepress/last-updated",
+        "plugin-back-to-top",
+        [
+            'vuepress-plugin-typescript',
+            {
+                tsLoaderOptions: {
+                },
+            },
+        ],
+    ],
     markdown: {
         lineNumbers: true
     },

+ 8 - 8
docs/dev/saga-graphy/graphy-engine/draw.md

@@ -1,13 +1,13 @@
-# 绘制
+# 绘制形状
+::: details 目录
+[[toc]]
+:::
 
-## 形状
+## 直线
 
-## 路径
+<DrawLine /> 
 
-## 文本
+<<< @/docs/.vuepress/components/DrawLine.vue
 
-## 图像
+## 折线
 
-## 蒙版
-
- 顺时针/逆时针 挖洞实现 

+ 5 - 1
docs/dev/saga-graphy/graphy-engine/gradient.md

@@ -1,7 +1,11 @@
 # 渐变
 
-渐变是一种有规律性的变化;引擎中分为线性渐变和放射性渐变
+::: details 点击查看代码
+<<< @/docs/.vuepress/components/ExampleWebGraphyDrawLine.vue
+:::
 
+渐变是一种有规律性的变化;引擎中分为线性渐变和放射性渐变
+41856
 渐变实现结构图
 
 ![渐变结构](./img/jianbianjiegou.png)

+ 2 - 0
docs/dev/saga-graphy/graphy-engine/image.md

@@ -0,0 +1,2 @@
+# 绘制图片
+

+ 3 - 0
docs/dev/saga-graphy/graphy-engine/text.md

@@ -0,0 +1,3 @@
+# 绘制文字
+
+

+ 3 - 0
docs/dev/saga-graphy/index.js

@@ -3,6 +3,9 @@ const content = [
         title: "绘图引擎",
         path: "/dev/saga-graphy/graphy-engine/",
         children: [
+            ["/dev/saga-graphy/graphy-engine/draw", "绘制形状"],
+            ["/dev/saga-graphy/graphy-engine/text", "绘制文字"],
+            ["/dev/saga-graphy/graphy-engine/image", "绘制图片"],
             ["/dev/saga-graphy/graphy-engine/gradient", "渐变"],
             ["/dev/saga-graphy/graphy-engine/composite", "融合"],
             ["/dev/saga-graphy/graphy-engine/arrow", "绘图指令-绘制带有箭头的线段"],

+ 3 - 0
package.json

@@ -12,6 +12,9 @@
     "publish": "node publish.js"
   },
   "dependencies": {
+    "@saga-web/base": "^2.1.9",
+    "@saga-web/draw": "^2.1.80",
+    "@saga-web/graphy": "^2.1.52",
     "axios": "^0.18.1",
     "element-ui": "^2.12.0",
     "vue": "^2.6.10",