<template>
  <div class="docs-demo-wrapper">
      <div :style="{maxHeight: isExpand ? '700px' : '0'}" class="demo-container">
        <div span="14">
          <div class="docs-demo docs-demo--expand">
            <div class="highlight-wrapper">
              <slot name="highlight"></slot>
            </div>
          </div>
        </div>
      </div>
    <span class="docs-trans docs-demo__triangle" @click="toggle">{{isExpand ? '隐藏代码' : '显示代码'}}</span>
  </div>
</template>

<script>
  /* eslint-disable */
  import Vue from 'vue'
  export default {
    data() {
      return {
        isExpand: false
      }
    },
    methods: {
      toggle() {
        this.isExpand = !this.isExpand;
      }
    }
  }
</script>
<style lang="less">

.demo-container {
    transition: max-height .3s ease;
    overflow-y: auto
}
.docs-demo-wrapper{
  margin-bottom: 30px;
}
.docs-demo {
    width: 100%;
    height: auto;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #f7f7f7;
    border: 1px solid #e2ecf4;
    border-top: none
}

.docs-demo pre code {
    font-family: Consolas, Menlo, Courier, monospace;
    line-height: 22px;
    border: none
}

.docs-trans {
    width: 100%;
    text-align: center;
    display: inline-block;
    color: #666;
    font-size: 12px;
    padding: 10px 0;
    background-color: #fafbfc;
    cursor: pointer;
}
.docs-trans:hover{
  color:#3c99fc;
}

.docs-demo__code,
.docs-demo__meta,
.highlight-wrapper {
    padding: 0 20px;
    overflow-y: auto
}

.docs-demo__code {
    border-bottom: 1px solid #eee
}

.docs-demo.docs-demo--expand .docs-demo__meta {
    border-bottom: 1px dashed #e9e9e9
}

.docs-demo.docs-demo--expand .docs-demo__triangle {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg)
}

.highlight-wrapper {
    display: none
}

.highlight-wrapper p,
.highlight-wrapper pre {
    margin: 0
}

.highlight-wrapper .hljs {
    padding: 0
}

.docs-demo.docs-demo--expand .highlight-wrapper {
    display: block
}

.docs-demo__code__mobi {
    height: 620px;
    margin: 20px 0
}

.docs-demo__code__mobi__header {
    border-radius: 4px 4px 0 0;
    background: linear-gradient(rgba(55, 55, 55, .98), #545456);
    text-align: center;
    padding: 8px
}

.docs-demo__code__mobi__header img {
    width: 100%
}

.docs-demo__code__mobi__header .url-box {
    height: 28px;
    line-height: 28px;
    color: #fff;
    padding: 0 3px;
    background-color: #a2a2a2;
    margin: 10px auto 0;
    border-radius: 4px;
    white-space: nowrap;
    overflow-x: auto
}

.docs-demo__code__mobi__content iframe {
    width: 100%;
    border: 0;
    height: 548px
}
.tit-desc, .sub-tit{
  color: #666;
}
.style-toggle{
  p{
    margin: 10px 0;
  }
}
.empty-text{
  color: #999;
  font-size: 14px;
}
// 这次的上传图案特别小
.k-upload .k-button{
  .icon-upload{
    font-size: 21px;
    vertical-align: middle;
  }
}
.file-len{
  color: #aaa;
  font-size: 12px;
}
.demo-block {
  .k-progress{
    margin-bottom: 16px;
  }
}
</style>

