tree: e1a71b0bf9bc0ac74b41b30b4c809434d8f9d6fd [path history] [tgz]
  1. index.js
  2. index.vue
  3. package.json
  4. README.md
  5. README_cn.md
  6. wxc-rich-text-icon.vue
  7. wxc-rich-text-link.vue
  8. wxc-rich-text-tag.vue
  9. wxc-rich-text-text.vue
packages/wxc-rich-text/README.md

wxc-rich-text

Rich text general solution, support text, icon, link, label form of mixing

Rule

  • Using unified specification, conventions related fields in front and back end.
  • wxc-rich-text supports a row of general graphic and text mixing.
  • wxc-special-rich-text supports two row of special mixing (tag + text、icon + text).

Demo

    

Code Example

<template>
  <div class='container'>
    <wxc-rich-text :config-list='configList'
                   @wxcRichTextLinkClick='wxcRichTextLinkClick'></wxc-rich-text>
     <div class='special-rich'>
       <wxc-special-rich-text @wxcSpecialRichTextClick="wxcSpecialRichTextClick"  :config-list='specialConfigList'></wxc-special-rich-text>
     </div>
  </div>
  
</template>
<script>
  import icon from './type.js';
  import { WxcRichText,WxcSpecialRichText } from 'weex-ui';

  export default {
    components: { WxcRichText, WxcSpecialRichText },
    data: () => ({
      configList: [{
        type: 'icon',
        src: 'https//gw.alicdn.com/tfs/TB1RRVWQXXXXXasXpXXXXXXXXXX-24-22.png',
        style: {
          height: 22
        }
      }, {
        type: 'text',
        value: 'yellow theme',
        theme: 'yellow'
      }, {
        type: 'link',
        value: 'link',
        href: '//h5.m.taobao.com',
        style: {
          color: '#546E7A'
        }
      }, {
        type: 'icon',
        src: icon.fliggy
      }, {
        type: 'tag',
        value: 'hello world',
        theme: 'red'
      }, {
        type: 'tag',
        value: 'custom tag',
        style: {
          fontSize: 26,
          color: '#ffffff',
          borderColor: '#3d3d3d',
          backgroundColor: '#546E7A',
          height: 36
        }
      }],
      specialConfigList: [
        {
          type: 'tag',
          value: 'happy go',
          style: {
            fontSize: 24,
            color: '#3D3D3D',
            borderColor: '#FFC900',
            backgroundColor: '#FFC900',
            borderRadius: 14,
          },
          tagDivStyle: {
            left: '50px'
          }
        },
        {
          type: 'text',
          value: 'Different from a web app you can use Weex to build a real mobile app.',
          theme: 'black',
          style: {
            fontSize: 28
          }
        }
      ],
    }),
    methods: {
      wxcRichTextLinkClick () {},
      wxcSpecialRichTextClick () {}
    }
  };
</script>

More details can be found in here

API

PropTypeRequiredDefaultDescription
config-listArrayY[]config list eg:Demo
has-text-marginBooleanN‘true’whether has text margin

Event

@wxcRichTextLinkClick='wxcRichTextLinkClick'
@wxcSpecialRichTextClick="wxcSpecialRichTextClick"