<template>
  <div class="content-page">
    <div class="content-page__header">
      <div class="content-page__header-title">
        <slot name="title"></slot>
      </div>
    </div>

    <div class="content-page__content" :style="contentStyle" ref="content">
      <div class="content_loading" v-if="loading">
        <Spin size="large"></Spin>
      </div>
      <slot v-else />
    </div>
    <!-- <Divider style="margin: 0px;" />
    <div class="content-foot">
      <div>微线索仅作为工具提供方,请遵守</div>
      <div>
        <a href="https://mp.weixin.qq.com/mp/opshowpage?action=newoplaw#t3-1" target="_blank">《微信公众平台运营规范》</a>
        <a href="https://open.weixin.qq.com/cgi-bin/frame?t=news/protocol_developer_tmpl" target="_blank">《微信开放平台协议》</a>
        <a href="https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1503979103&version=1&lang=zh_CN&platform=2"
          target="_blank">《微信公众平台协议》</a>
        <a href="https://pay.weixin.qq.com/index.php/public/apply_sign/protocol_v2" target="_blank">《微信商户号服务协议》</a>
        <a href="https://weixin.qq.com/cgi-bin/readtemplate?t=weixin_external_links_content_management_specification"
          target="_blank">《微信外部链接内容管理规范》</a>
        <a href="https://work.weixin.qq.com/nl/eula" target="_blank">《企业微信服务协议》</a>
      </div>
      <div>等微信相关管理规范</div>
    </div> -->
  </div>
</template>

<script>

export default {
  name: 'ContentPage',
  data () {
    return {
    }
  },
  props: {
    contentPadding: [String, Number],
    loading: Boolean
  },
  computed: {
    contentStyle () {
      if (this.contentPadding) {
        return {
          padding: typeof this.contentPadding === 'string' ? this.contentPadding : this.contentPadding + 'px'
        }
      }
      return ''
    },
  },
  watch: {

  },
  created () {

  },
}
</script>

<style scoped>
.content-page {
  height: 100%;
  padding: 0px 2px;
}

.content-page__content::-webkit-scrollbar {
  width: 4px;
  /* height: 4px; */
}
.content-page__content::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 5px #cfcfcf;
  background: #cfcfcf;
}
.content-page__content::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 5px #ffffff;
  border-radius: 0;
  background: #ffffff;
}
.content-page__content .content_loading {
    display: flex;
    height: 100%;
    justify-content: center;
    align-items: center;
}
.content-page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* height: 40px; */
  color: #111827;
}
.content-page__header-title >>> .ivu-tabs-nav {
  color: #111827;
}

.content-page__header-title {
  font-size: 16px;
  /* margin-left: 45px; */
}

.content-page__header-subtitle {
  font-size: 12px;
  color: #999;
  margin-left: 12px;
}

.content-page__content {
  box-shadow: 0 12px 32px -12px #ffffff;
  border-radius: 0px 8px 0px 0px;
  /* overflow: hidden; */
  height: 100%;
  background-color: #fff;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 20px;
  /* padding-bottom: 40px; */
}
.content-foot {
  text-align: center;
  padding: 10px 0px;
  line-height: 22px;
  font-size: 13px;
  color: #515a6e;
  background: #fff;
  border-radius: 0px 0px 8px 8px;
}
/* tab样式 */

.content-page__header-title >>> .ivu-tabs {
  top: 10px;
}

.content-page__header-title >>> .ivu-tabs-ink-bar {
  height: 3px;
  /* width: 56px !important;
  left: 16px !important; */
}
.content-page__header-title >>> .ivu-tabs-bar {
  border-width: 0px;
  margin-bottom: 0;
}
</style>
