tree: 8a2f088fc2c92459ba34c32f329fb926f3c1824b [path history] [tgz]
  1. index.js
  2. index.vue
  3. package.json
  4. README.md
  5. README_cn.md
  6. type.js
packages/wxc-noticebar/README.md

wxc-noticebar

Notice bar

Rule

  • Component to display a system message, event notice and etc. Which is under the navigation bar.
  • Be used to attract user's attension, the importance level is lower than Modal and higher than Toast.
  • Should be concise and clear, too long will... ,but you can set lines=2.

Demo

    

Code Example

<template>
  <div class="container">
    <div class="demo">
      <wxc-noticebar
        mode="link"
        notice="notice,can jump"
        type="info"
        @wxcNoticebarLinkClicked="wxcNoticebarLinkClicked"
        notice-url="//h5.m.taobao.com/trip/home/index.html">
      </wxc-noticebar>
    </div>
    <div class="demo">
      <wxc-noticebar mode="closable"
                     notice="text notice,text notice,text notice,text notice,text notice,text notice,text notice"
                     :lines="2"
                     type="warn"></wxc-noticebar>
      </wxc-noticebar>
    </div>
  </div>
</template>

<script>
  const modal = weex.requireModule('modal');
  import { WxcNoticebar } from 'weex-ui';
  export default {
    components: { WxcNoticebar },
    data: () => ({
      show: true
    }),
    methods: {
      wxcNoticebarCloseClicked(e){
        console.log(e);
        modal.toast({ 'message': 'wxcNoticebarCloseClicked', 'duration': 1 });
      },
      wxcNoticebarLinkClicked(e){
        console.log(e);
        modal.toast({ 'message': 'wxcNoticebarLinkClicked', 'duration': 1 });
      }
    }
  };
</script>

More details can be found in here

Api

PropTypeRequiredDefaultDescription
noticeStringY-notice text
notice-urlStringY-jump link, no no jump
modeStringY-notice mode (right icon) link/closable
typeStringY-notice type (left icon)success/error/info/question/time /redbag
linesNumberY1text lines

Event

`@wxcNoticebarLinkClicked="wxcNoticebarLinkClicked"`
`@wxcNoticebarCloseClicked="wxcNoticebarCloseClicked"`