|
@@ -1,34 +1,39 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <Block
|
|
|
- title="Async"
|
|
|
- desc="这里主要是异步遍历的函数集合,函数会等待上一次异步结束才会开始下一个"
|
|
|
+ <div class="flow-wrap">
|
|
|
+ <!-- <svg
|
|
|
+ version="1.1"
|
|
|
+ baseProfile="full"
|
|
|
+ xmlns="http://www.w3.org/2000/svg"
|
|
|
+ xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
+ xmlns:ev="http://www.w3.org/2001/xml-events"
|
|
|
>
|
|
|
- <p class="demo">DEMO</p>
|
|
|
- <Codemirror v-model="code" :disabled="true" />
|
|
|
- </Block>
|
|
|
+ <rect x="0" y="0" width="10" height="10" fill="blue" />
|
|
|
+ <text x="5" y="30">A nice rectangle</text>
|
|
|
+ <circle cx="50" cy="50" r="50" fill="#529fca" />
|
|
|
+ <polygon
|
|
|
+ points="9.9, 2.2, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78"
|
|
|
+ />
|
|
|
+
|
|
|
+ <SvgRect />
|
|
|
+ </svg> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import Block from "@/components/block.vue";
|
|
|
-import { ref } from "vue";
|
|
|
-import { Codemirror } from "vue-codemirror";
|
|
|
-
|
|
|
-const code = ref(`import { asyncWhile, asyncForEach, nextTick } from "ludash";
|
|
|
-
|
|
|
-asyncForEach([1, 2, 3, 4, 5], async (it, index) => {
|
|
|
- await nextTick(1000);
|
|
|
- console.log(it, index);
|
|
|
- // return false 则会中断执行
|
|
|
- return true;
|
|
|
-});
|
|
|
-
|
|
|
-asyncWhile(
|
|
|
- // checker 这是判断函数
|
|
|
- async (index) => index < 10,
|
|
|
- async (index) => {
|
|
|
- console.log(index);
|
|
|
- }
|
|
|
-);`);
|
|
|
+import SvgRect from "./components/svgRect.vue";
|
|
|
</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.flow-wrap {
|
|
|
+ height: 45px;
|
|
|
+ background-color: blue;
|
|
|
+ background-image: linear-gradient(
|
|
|
+ transparent 0px,
|
|
|
+ transparent 2px,
|
|
|
+ #fff 2px,
|
|
|
+ #fff 15px
|
|
|
+ ),
|
|
|
+ linear-gradient(90deg, #999 0px, #999 2px, #fff 2px, #fff 15px);
|
|
|
+ background-size: 15px 15px, 15px 15px;
|
|
|
+}
|
|
|
+</style>
|