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

wxc-minibar

Title Bar

Rule

  • Use the Native Navigator Bar first.
  • If you want to hide the return button on the left, pass leftButton="" directly.

Demo

    

Code Example

<template>
  <div class="container" :style="{ height: height }">
    <div class="demo">
      <wxc-minibar title="title"
                   background-color="#009ff0"
                   text-color="#FFFFFF"
                   right-text="more"
                   @wxcMinibarLeftButtonClicked="minibarLeftButtonClick"
                   @wxcMinibarRightButtonClicked="minibarRightButtonClick"></wxc-minibar>
    </div>
  </div>
</template>

<script>

  import { WxcMinibar } from 'weex-ui';
  const modal = weex.requireModule('modal');

  export default {
    components: { WxcMinibar },
    methods: {
      minibarLeftButtonClick () {
      },
      minibarRightButtonClick () {
        modal.toast({ 'message': 'click rightButton!', 'duration': 1 });
      }
    }
  };
</script>

More details can be found in here

API

PropTypeRequiredDefaultDescription
titleStringY-title
right-buttonStringN-right button icon
right-textStringN-right button text
left-buttonStringNa return iconleft button icon
left-textStringN``left text
text-colorStringN#333333text color
background-colorStringN#fffffftitle bar background color
use-default-returnBooleanNtrueWhether to use the default return
showBooleanNtruewhether to show
bar-styleObjectN{}modify original style

Slot

When the above configurations are not satisfied, You can customize this component by using slot. weex-ui>=0.3.9

  1. <slot name="left"></slot>:left slot
  2. <slot name="middle"></slot>:title slot
  3. <slot name="right"></slot>:right slot
<wxc-minibar background-color="#FFF3CD">
  <image src="https://img.alicdn.com/tfs/TB1QN8pdlHH8KJjy0FbXXcqlpXa-220-80.png"
         slot="left"
         style="height: 32px;width: 88px;"></image>
  <text style="font-size: 40px;" slot="middle">Customize this component</text>
  <image slot="right"
         src="https://img.alicdn.com/tfs/TB1j39Uc0fJ8KJjy0FeXXXKEXXa-160-128.png"
         style="height: 32px;width: 40px"></image>
</wxc-minibar>

Event

// @wxcMinibarLeftButtonClicked="minibarLeftButtonClick"
// @wxcMinibarRightButtonClicked="minibarRightButtonClick"