<template>
  <div class="component-wrapper">
    <hgroup class="component-hgroup">
      <h1 class="component-title">Icon (图标)</h1>
      <h2 class="component-subtitle">字体图标，使用方便，样式修改和普通字体一样</h2>
      <h3 class="component-notice">图标丰富</h3>
    </hgroup>

    <section class="component-item">
      <hgroup class="component-item-hgroup">
        <h1 class="component-item-title">代码示例</h1>
      </hgroup>

      <sv-example>
        <h2 slot="title">基本用法</h2>
        <h2 slot="subtitle">通过icon属性指定图标，通过color属性设置颜色，通过size属性设置大小</h2>
        <template slot="preview">
          <sv-icon icon="close"></sv-icon>
          <sv-icon icon="search" size="large"></sv-icon>
          <sv-icon icon="clear" size="small"></sv-icon>
          <sv-icon icon="exit" color="info"></sv-icon>
        </template>
        <template slot="code">
          <sv-code>
            <sv-code-item code='<sv-icon icon="close"></sv-icon>'></sv-code-item>
            <sv-code-item code='<sv-icon icon="search" size="large"></sv-icon>'></sv-code-item>
            <sv-code-item code='<sv-icon icon="clear" size="small"></sv-icon>'></sv-code-item>
            <sv-code-item code='<sv-icon icon="exit" color="info"></sv-icon>'></sv-code-item>
          </sv-code>
        </template>
      </sv-example>
    </section>

    <section class="component-item api">
      <hgroup class="component-item-hgroup">
        <h1 class="component-item-title">API</h1>
      </hgroup>

      <div class="component-item-content no-header">
        <!--<div class="component-item-content-header">-->
          <!--<h1 class="component-item-content-title">Icon</h1>-->
          <!--<h1 class="component-item-content-subtitle"></h1>-->
        <!--</div>-->
        <div class="component-item-content-main api">
          <sv-tabs stripe position="top">
            <sv-tab :value="0" title="Props">
              <sv-table :data="apiData.props">
                <sv-table-column prop="name" title="名称" width="100"></sv-table-column>
                <sv-table-column prop="description" title="描述" width="100"></sv-table-column>
                <sv-table-column prop="type" title="类型"></sv-table-column>
                <sv-table-column prop="optional" title="可选值"></sv-table-column>
                <sv-table-column prop="default" title="默认值"></sv-table-column>
              </sv-table>
            </sv-tab>
            <sv-tab :value="1" title="Slots"></sv-tab>
            <sv-tab :value="2" title="Events">
              <!--
              <sv-table :data="apiData.tabs.events">
                <sv-table-column prop="name" title="事件名称" width="100"></sv-table-column>
                <sv-table-column prop="description" title="描述" width="200"></sv-table-column>
                <sv-table-column prop="param" title="回调参数" width="300"></sv-table-column>
              </sv-table>
              -->
            </sv-tab>
          </sv-tabs>
        </div>
      </div>
    </section>
    <section class="component-item api">
      <hgroup class="component-item-hgroup">
        <h1 class="component-item-title">图标库</h1>
      </hgroup>

      <div class="component-item-content no-header">
        <div class="component-item-content-main api">
          dfadss
        </div>
      </div>
    </section>
  </div>
</template>

<script type="text/ecmascript-6">
  import Code from '../components/Code.vue'
  import CodeItem from '../components/CodeItem.vue'
  export default {
    components: {
      svCode: Code,
      svCodeItem: CodeItem
    },
    data () {
      return {
        apiData: {
          props: [
            {
              name: 'icon',
              description: '图标',
              type: 'string',
              optional: '参见下方图标库',
              default: '-'
            },
            {
              name: 'size',
              description: '图标的尺寸',
              type: 'string',
              optional: 'small,default(或者不写),large',
              default: 'default'
            },
            {
              name: 'color',
              description: '图标颜色',
              type: 'string',
              optional: '参见Color组件',
              default: '-'
            }
          ],
          slots: [],
          events: []
        }
      }
    }
  }
</script>

<style lang="scss" rel="stylesheet/scss">
  @import "../../src/styles/base";
  @import "../styles/components";
</style>
