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

wxc-mask

A pop-up mask

Demo

    

Code Example

<template>
  <div class="wrapper">
    <div class="btn" @click="openMask">
      <text class="btn-txt">Pop up a animation mask</text>
    </div>
    <div class="btn btn-margin yellow" @click="openNoAnimationMask">
      <text class="btn-txt">Pop up a no animation mask</text>
    </div>
    <wxc-mask height="800"
              width="702"
              border-radius="0"
              duration="200"
              mask-bg-color="#FFFFFF"
              :has-animation="hasAnimation"
              :has-overlay="true"
              :show-close="true"
              :show="show"
              @wxcMaskSetHidden="wxcMaskSetHidden">
      <div class="content">
        <div class="demo-title">
          <text class="title">Help you build a real Native App</text>
        </div>
        <text class="content-text">
          Different from a "web app", "HTML5 app", or "hybrid app", you can use Weex to build a real mobile app. The code that you write is relatively simple, because you can build native applications just using HTML, CSS, Javascript. But underneath, the core of the application is Objective-C or Java. At the same time, Weex will provide a lot of native components or modules for developers to use.
        </text>
      </div>
    </wxc-mask>
  </div>
</template>

<script>
  import { WxcMask } from 'weex-ui';
  export default {
    components: { WxcMask },
    data: () => ({
      show: false,
      overlayCanClose: true,
      isFalse: false,
      hasAnimation: true
    }),
    methods: {
      openMask (e) {
        this.show = true;
        this.hasAnimation = true;
      },
      wxcMaskSetHidden () {
        this.show = false;
      },
      openNoAnimationMask (e) {
        this.show = true;
        this.hasAnimation = false;
      }
    }
  };
</script>

More details can be found in here

API

PropTypeRequiredDefaultDescription
showBoolYfalsewhether to show
widthNumberY702mask width
heightNumberY800mask height
topNumberN0mask top, will centered in vertical direction when equal to 0
has-animationBoolNtruemask pops up whether to animate
show-closeBoolNfalsewhether to show close icon
has-overlayBoolNtruewhether has a overlay
border-radiusNumberN0mask border radius
overlay-can-closeBoolNtrueWhether the overlay can be closed
mask-bg-colorStringN#ffffffmask background color
durationStringN300animation duration time
timing-functionStringNease-inanimation timing function
overlay-cfgObjectN{}wxc-overlay configs
opacityNumberN0.6set transparency

Event

//need set `show=false` when the mask hide
@wxcMaskSetHidden="wxcMaskSetHidden" 

@wxcMaskCloseClick="wxcMaskCloseClick"
@wxcOverlayBodyClicked="wxcOverlayBodyClicked"