VUE2.0 "v-html" label usage tips

Source: Internet
Author: User

<Divclass= "Active-rules">    <Divclass= "Weui-weixin-content"ID= "Rules">        <P>Activity name: {{Message1}}</P>        <P>Active Time: {{message2}}</P>        <P>Event Prizes:<spanv-html= "NewMessage3">{{NewMessage3}}</span></P>        <P>Awards time: {{message4}}</P>        <P>{{Message5}}</P>    </Div>    <Divclass= "Acrive-line"></Div>    <Divclass= "Active-code">        <P>Two-dimensional code for business</P>        <Divclass= "Code">            <imgsrc=".. /.. /.. /static/b2b-reception/images/icon-exchange-3.png ">        </Div>        <Divclass= "Active-btn">            <ahref= "javascript:;"class= "Weui_btn Weui_btn_warn">Return</a>        </Div>    </Div></Div>
    NewVue ({el:' #rules ', data:{message1:' Thanksgiving rewards Big carousel ', Message2:' 2017.9.22-2016.10.31 ', Message3:' 1. Color ball A note to the general point 100 barium ', Message4:' Immediately after winning the lottery. ‘, Message5:' Please pay attention to the public number (* * pass) Click on the menu big turntable participation Activities '}, computed: {newMessage3:function () {                varstr = ""; varNewstr = This. Message3.split (' ~ ');  for(vari=0;i<newstr.length;i++) {str+=newstr[i] + "</br>"                }                returnstr; }        }    });
Message3 content length is not certain, each content uses the ~ division, in the page uses Vue's computed method to process the data, and then uses the v-html instruction to render to the page, the normal {{Message3}} will render the content all by default to the string,

VUE2.0 "v-html" label usage tips

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.