zoukankan      html  css  js  c++  java
  • xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

    component & slot

    <template>
      <div class="myHeaderContainer">
        <header class="myHeader" :class="{ 'fixed': fixed }">
          <div class="top_bar">
            <div class="abs_l">
              <slot name="left">
                <a slot="left" class="back-white" @click.stop="back"></a>
              </slot>
            </div>
            <div class="abs_m">
              {{title}}
              <slot name="mid"></slot>
            </div>
            <div class="abs_r">
              <slot name="right"></slot>
            </div>
          </div>
        </header>
      </div>
    </template>
    <script>
    import LightSDK from "light-sdk";
    export default {
      props: {
        fixed: Boolean,
        title: String
      },
      methods: {
        back() {
          LightSDK.native.back({ number: "1" });
        }
      }
    };
    </script>
    <style lang='less' scoped>
    // header_height = 1.335rem
      .myHeaderContainer {
        height: 0.86rem;
      }
    .myHeader {
      display: block;
      position: relative;
      overflow: hidden;
      background-color: #1a90ff;
      color: #fff;
      font-size: 16px;
    
      &.fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 666;
      }
      .top_bar {
        position: relative;
        height: 0.86rem;
        user-select: none;
        display: flex;
        align-items: center;
        a {
          display: table-cell;
           0.86rem;
          height: 0.86rem;
          color: inherit;
          font-size: inherit;
          font-weight: inherit;
          text-decoration: none;
          vertical-align: middle;
        }
        .abs_l,
        .abs_r {
           0.86rem;
          height: 0.86rem;
          font-size: inherit;
          color: inherit;
          text-align: center;
        }
        .abs_m {
          flex: 1;
          font-weight: 700;
          text-align: center;
        }
      }
    }
    </style>
    
    
    

    demo

    <my-header
        fixed
        title="名片夹">
        <span slot="right"
            v-if="isShowBusiness && selected === `2`"
            class="chat-header-icon chat-header-search"
            @click="handleSearch"
            ref="chat-search">
        </span>
    </my-header>
    
    

    demos

    
    
    
    
    

    refs

    https://www.cnblogs.com/xgqfrms/p/10979925.html



    ©xgqfrms 2012-2020

    www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


  • 相关阅读:
    linux/windows nginx安装
    linux/windows vsftpd安装
    linux 操作命令
    linux/windows java tomcat安装
    常见的Activity Action Intent常量
    Intent.ACTION_PICK
    Android实现抽奖转盘
    Android-短信验证
    Android-多平台分享(新浪微博)
    Android 手势滑动,多点触摸放大缩小图片
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/11218372.html
Copyright © 2011-2022 走看看