You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/06/28 04:02:40 UTC

[incubator-echarts-doc] branch live-example updated: example: change icon of try it

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch live-example
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git


The following commit(s) were added to refs/heads/live-example by this push:
     new cf1c986  example: change icon of try it
cf1c986 is described below

commit cf1c98634837e820a6de36213b2064a1325b6a83
Author: pissang <bm...@gmail.com>
AuthorDate: Sun Jun 28 12:02:30 2020 +0800

    example: change icon of try it
---
 src/App.vue                           |  12 ++++++++++++
 src/asset/icon.eot                    | Bin 0 -> 1440 bytes
 src/asset/icon.svg                    |  11 +++++++++++
 src/asset/icon.ttf                    | Bin 0 -> 1276 bytes
 src/asset/icon.woff                   | Bin 0 -> 1352 bytes
 src/components/DocContentItemCard.vue |  27 +++++++++++++++++++++++----
 src/components/DocNav.vue             |   4 ++--
 src/components/LiveExample.vue        |   4 ++--
 src/style/mixin.scss                  |   3 ++-
 zh/option/series/bar.md               |   2 +-
 10 files changed, 53 insertions(+), 10 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index f3784a8..4edf29d 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -73,6 +73,18 @@ export default {
 // @import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');
 @import url('https://fonts.googleapis.com/css?family=Source+Code+Pro&display=swap');
 
+@font-face {
+  font-family: 'iconfont';
+  src:  url('./asset/icon.eot');
+  src:  url('./asset/icon.eot#iefix') format('embedded-opentype'),
+    url('./asset/icon.ttf') format('truetype'),
+    url('./asset/icon.woff') format('woff'),
+    url('./asset/icon.svg') format('svg');
+  font-weight: normal;
+  font-style: normal;
+  font-display: block;
+}
+
 .ec-doc {
     // font-family: "Helvetica Neue", "Segoe UI", Arial, "PingFang SC", STHeiti, "Microsoft Yahei", sans-serif;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Helvetica, Arial, sans-serif;
diff --git a/src/asset/icon.eot b/src/asset/icon.eot
new file mode 100644
index 0000000..28362b4
Binary files /dev/null and b/src/asset/icon.eot differ
diff --git a/src/asset/icon.svg b/src/asset/icon.svg
new file mode 100644
index 0000000..3dbd03e
--- /dev/null
+++ b/src/asset/icon.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="icomoon" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="960" descent="-64" />
+<missing-glyph horiz-adv-x="1024" />
+<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
+<glyph unicode="&#xe900;" glyph-name="try" horiz-adv-x="1073" d="M292.571 813.714c0-80.791-65.494-146.286-146.286-146.286s-146.286 65.494-146.286 146.286c0 80.791 65.494 146.286 146.286 146.286s146.286-65.494 146.286-146.286zM434.812 862.476c-5.873 35.007-17.963 67.907-35.096 97.524h380.474c134.652 0 243.81-109.157 243.81-243.81v-239.922c-17.44 12.333-37.865 21.022-60.348 24.769l-37.176 6.196v208.956c0 80.791-65.494 146.286-146.286 146.286h-345.379zM146.286 521.143v-292.571c0-80.791 65.4 [...]
+</font></defs></svg>
\ No newline at end of file
diff --git a/src/asset/icon.ttf b/src/asset/icon.ttf
new file mode 100644
index 0000000..8523a69
Binary files /dev/null and b/src/asset/icon.ttf differ
diff --git a/src/asset/icon.woff b/src/asset/icon.woff
new file mode 100644
index 0000000..43ac0d9
Binary files /dev/null and b/src/asset/icon.woff differ
diff --git a/src/components/DocContentItemCard.vue b/src/components/DocContentItemCard.vue
index 67c0569..505621e 100644
--- a/src/components/DocContentItemCard.vue
+++ b/src/components/DocContentItemCard.vue
@@ -26,8 +26,13 @@
 
         <span class="default-value" v-if="nodeData.default && nodeData.default !== '*'"> = {{nodeData.default}}</span>
 
-        <span class="control-toggle" v-if="uiControl && shared.allOptionExamples">
-            <el-switch :active-text="$t('example.tryDesc')" v-model="enableUIControl"></el-switch>
+        <span
+            :class="['control-toggle', enableUIControl ? 'active' : '']"
+            v-if="uiControl && shared.allOptionExamples"
+            @click="toggleUIControl"
+        >
+            &#xe900; {{$t('example.tryDesc')}}
+            <!-- <el-switch :active-text="$t('example.tryDesc')" v-model="enableUIControl"></el-switch> -->
         </span>
     </h4>
 
@@ -198,7 +203,9 @@ export default {
             this.manualExpanded = !this.expanded;
             this.$emit('toggle-expanded');
         },
-
+        toggleUIControl() {
+            this.enableUIControl = !this.enableUIControl;
+        },
         bubbleScrollToSelfEvent(path, time, delay) {
             this.$emit('scroll-to-self', path, time, delay);
         }
@@ -323,6 +330,18 @@ $hierarchy-guider-color: #C592A0;
         .control-toggle {
             float: right;
             font-size: 14px;
+            font-family: iconfont;
+            cursor: pointer;
+
+            color: #555;
+
+            &:hover {
+                color: #999;
+            }
+
+            &.active {
+                color: #409eff;
+            }
         }
     }
 
@@ -422,7 +441,7 @@ $hierarchy-guider-color: #C592A0;
         background-color: #f9f2f4;
         font-size: 12px;
     }
-    
+
     .prop-type-string {
         background-color: #f9f2f4;
     }
diff --git a/src/components/DocNav.vue b/src/components/DocNav.vue
index 43fef3d..dfdfc7d 100644
--- a/src/components/DocNav.vue
+++ b/src/components/DocNav.vue
@@ -280,9 +280,9 @@ export default {
         font-family: Monaco,'Source Code Pro', monospace;
         font-size: 13px;
         white-space: nowrap;
-        
+
         .default-value {
-            color: #f4f4f4;
+            color: #999;
         }
     }
 }
diff --git a/src/components/LiveExample.vue b/src/components/LiveExample.vue
index ec6aec1..8ced7d6 100644
--- a/src/components/LiveExample.vue
+++ b/src/components/LiveExample.vue
@@ -24,7 +24,7 @@
             ></el-option>
         </el-select>
         <el-button v-if="shared.currentExampleOption" type="primary" icon="el-icon-refresh" size="mini" @click="refreshForce">{{$t('example.refresh')}}</el-button>
-        <el-button size='mini' @click="closeExamplePanel">{{$t('example.close')}}</el-button>
+        <el-button size='mini' circle icon="el-icon-close" @click="closeExamplePanel"></el-button>
     </div>
 </div>
 </template>
@@ -311,7 +311,7 @@ export default {
                 }
                 return value;
             });
-            return `const option = ${optStr}`;
+            return `option = ${optStr}`;
         },
 
         formattedOptionCodeStr() {
diff --git a/src/style/mixin.scss b/src/style/mixin.scss
index ccdca92..5836cdd 100644
--- a/src/style/mixin.scss
+++ b/src/style/mixin.scss
@@ -42,8 +42,9 @@
     p {
         line-height: 1.7em;
         margin: 12px 0 12px 0;
-        font-size: 16px;
+        font-size: 14px;
     }
+
     pre {
         margin: 5px 0;
         border-radius: 5px;
diff --git a/zh/option/series/bar.md b/zh/option/series/bar.md
index 6ff6e17..d1b169f 100644
--- a/zh/option/series/bar.md
+++ b/zh/option/series/bar.md
@@ -107,7 +107,7 @@ option = {
 
 {{ use: partial-version(version = "4.5.0") }}
 
-<ExampleUIControlBoolean />
+<ExampleUIControlBoolean clean="true" />
 
 是否在环形柱条两侧使用圆弧效果。
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org