ppmoney 總結二

來源:互聯網
上載者:User

標籤:sse   block   contract   style   箭頭   alt   row   注意   indicator   

1. return false   ES6函數的擴充:箭頭函數  數組 arr.map()   arr.filter() 

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Title</title></head><body><script>  var o = {      num (a) {          if(a>4){              a=1;              return false;   // return false 表示 不執行了。          }          a=10;          return a;      }  }  console.log(o.num(21));   //  false  var arr = [1,2,3];  console.log(arr.map(x => x * x));  // 相當於for迴圈  console.log(arr.filter(x => x > 1)); // 過濾條件  把x>1的過濾出來 【2,3】  //函數的擴充,箭頭函數  var f = x=>x*12;  console.log(f(2));  var f2 = ()=>10;  console.log(f2());  var f3 = (a,b)=>a+b;  console.log(f3(4, 5));</script></body></html>
View Code

2.ppmoney  Test.vue   TestOne.vue 路由傳值等

Test.vue

<template>  {{mes}}  <button @click="test">btn</button>  <group>    <x-input      title=‘名字‘      placeholder=‘請輸入你的名字‘      :value.sync="name">    </x-input>    <x-input      title=‘愛好‘      placeholder=‘請輸入你的愛好‘      :value.sync="hobby">    </x-input>    <x-button type="primary" @click="goToTestOne">立即申請</x-button>  </group>  <div>    <img :src="arrowSrc" alt="">    <p :class="{‘red-font‘:isRed}">紅色字型</p>  </div></template><style>  .red-font{color:red;}</style><script>  export default{    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‘, ‘中國‘)    //   兩種寫法      },      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>  export default{    data () {      return {        name: ‘‘,        hobby: ‘‘,        mes: ‘123234‘      }    },    created () {          //  用  create ()      this.$data.name = this.$route.query.name        // 注意這裡是 $route  沒有‘r‘      this.$data.hobby = this.$route.query.hobby    }  }</script>
TestOne.vue

 

ppmoney 總結二

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.