feat(shortcodes): add width and height params for echarts shortc… (#192)

This commit is contained in:
Dillon
2020-03-21 20:52:12 +08:00
committed by GitHub
parent aed8734d83
commit b6ce753ae7
6 changed files with 34 additions and 4 deletions

View File

@@ -2,5 +2,7 @@
{{- $content := .Inner | transform.Unmarshal | jsonify -}}
{{- $id := partial "function/id.html" (dict "content" $content "scratch" $scratch) -}}
<div class="echarts" id="{{ $id }}"></div>
{{- $width := cond .IsNamedParams (.Get "width") (.Get 0) | default "100%" -}}
{{- $height := cond .IsNamedParams (.Get "height") (.Get 1) | default "30rem" -}}
<div class="echarts" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
{{- $scratch.Set "echarts" true -}}