Ppmoney Summary Two

Source: Internet
Author: User

1. Return false ES6 extension of function: Arrow function array Arr.map () Arr.filter ()

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Title</title></Head><Body><Script>  varo={num (a) {if(A>4) {a=1; return false; //return False indicates that no execution has been performed. } a=Ten; returnA; }} console.log (O.num ( +)); //false  vararr= [1,2,3]; Console.log (Arr.map (x=x*x)); //equivalent for loopConsole.log (arr.filter (x=x> 1)); //filter conditions to filter out the x>1 "2,3"  //extension of function, arrow function  varF=x=x* A; Console.log (f (2)); varF2= ()=Ten;  Console.log (F2 ()); varf3=(A, b)=a+b; Console.log (F3 (4, 5));</Script></Body></HTML>
View Code

2.ppmoney Test.vue Testone.vue Routing value, etc.

Test.vue

<Template>{{mes}}<Button@click= "Test">Btn</Button>  <Group>    <X-inputtitle= ' name 'placeholder= ' Please enter your name ': Value.sync= "Name">    </X-input>    <X-inputtitle= ' hobby 'placeholder= ' Please enter your hobby ': Value.sync= "Hobby">    </X-input>    <X-buttontype= "PRIMARY"@click= "Gototestone">Apply Now</X-button>  </Group>  <Div>    <img: src= "Arrowsrc"alt="">    <P: Class= "{' Red-font ': isred}">Red font</P>  </Div></Template><style>. Red-font{Color:Red;}</style><Script>Exportdefault{components: {Group:require ('Vux-components/group'), Xinput:require ('Vux-components/x-input'), Xbutton:require ('Vux-components/x-button')}, data () {return{name:"', Hobby:"', Mes:'123234', Arrowsrc:require ('.. /assets/images/helper/help-arrow-down.png'), isred:true}}, methods: {Test () {//This . $data. mes = ' 456 '         This. $set ('mes', 'China')    //two ways to do it}, Gototestone () {//This . $router. Go ('/testone ')         This. $router. Go ({path:'/testone', query: {name: This. $data. Name, hobby: This. $data. Hobby}}) }    }  }</Script>
Test.vue

Testone.vue

<Template>{{mes}}<P>{{Name}}</P>  <P>{{Hobby}}</P></Template><Script>Exportdefault{data () {return{name:"', Hobby:"', Mes:'123234'}}, created () {//with Create ()       This. $data. Name=  This. $route. Query.name//Notice here is $route no ' r '       This. $data. Hobby=  This. $route. Query.hobby}}</Script>
Testone.vue

Ppmoney Summary Two

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.