tree: a7c1d9bcf38e4dccc2be501275e5d2469dd4e4ca [path history] [tgz]
  1. index.js
  2. index.vue
  3. package.json
  4. README.md
  5. README_cn.md
packages/wxc-overlay/README.md

wxc-overlay

Mask layer

Rule

  • Often used in wxc-mask, wxc-dialog, wxc-popup, etc

Demo

    

Code Example

<template>
  <div class="wrapper">
    <div class="btn" @click="openOverlay">
      <text class="btn-txt">Click</text>
    </div>
    <wxc-overlay
      :show="show"
      opacity="0.6"
      @wxcOverlayBodyClicked="wxcOverlayBodyClicked"></wxc-overlay>
  </div>
</template>
<script>
  import { WxcOverlay } from 'weex-ui';
  export default {
    components: { WxcOverlay },
    data: () => ({
      show: false
    }),
    methods: {
      openOverlay () {
        this.show = true;
      },
      wxcOverlayBodyClicked () {
        this.show = false;
      }
    }
  };
</script>

More details can be found in here

API

PropTypeRequiredDefaultDescription
showBooleanYfalsewhether to show
opacityNumberN0.6opacity 0-1
leftNumberN0move left distance
topNumberN0move top distance
has-animationBooleanNtruewhether to animate
can-auto-closeBooleanNtruewhether to can auto close
durationNumber300Nanimation duration time
timing-functionArrayN['ease-in','ease-out']animation timing function

Event

 // disappear after
 `@wxcOverlayBodyClicked="wxcOverlayBodyClicked"`;
 // disappearing
 `@wxcOverlayBodyClicking="wxcOverlayBodyClicking"`;