<template>
  <sv-layout>
    <sv-main has-footer>
      <div class="component-wrapper">
        <hgroup class="component-hgroup">
          <h1 class="component-title">Footer (底部)</h1>
          <h2 class="component-subtitle">底部主要放置按</h2>
          <h3 class="component-notice">用法几乎和Header组件一样</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">默认背景色为白色，固定在底部</h2>
            <template slot="preview">
            </template>
            <template slot="code">
              <sv-code>
                <sv-code-item code='<sv-footer>底部Footer</sv-footer>'></sv-code-item>
              </sv-code>
            </template>
          </sv-example>
        </section>

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

          <div class="component-item-content">
            <div class="component-item-content-main api">
              <sv-tabs position="top" stripe slidable>
                <sv-tab :value="0" title="Props">
                  <sv-table :data="apiData.props">
                    <sv-table-column prop="name" title="名称"></sv-table-column>
                    <sv-table-column prop="description" title="描述"></sv-table-column>
                    <sv-table-column prop="type" title="类型"></sv-table-column>
                    <sv-table-column prop="optional" title="可选值" width="120"></sv-table-column>
                    <sv-table-column prop="default" title="默认值"></sv-table-column>
                  </sv-table>
                </sv-tab>
                <sv-tab :value="1" title="Slots">
                  <sv-table :data="apiData.slots">
                    <sv-table-column prop="name" title="名称"></sv-table-column>
                    <sv-table-column prop="description" title="描述"></sv-table-column>
                  </sv-table>
                </sv-tab>
                <sv-tab :value="2" title="Events">
                  <sv-table :data="apiData.events">
                    <sv-table-column prop="name" title="名称"></sv-table-column>
                    <sv-table-column prop="description" title="描述"></sv-table-column>
                  </sv-table>
                </sv-tab>
              </sv-tabs>
            </div>
          </div>
        </section>
      </div>
    </sv-main>
    <sv-footer>
      底部Footer
    </sv-footer>
  </sv-layout>
</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: 'title',
              description: '标题',
              type: 'string',
              optional: '-',
              default: '-'
            },
            {
              name: 'color',
              description: '颜色',
              type: 'string',
              optional: '官方内置的所有颜色',
              default: 'light'
            }
          ],
          slots: [],
          events: []
        }
      }
    }
  }
</script>

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