亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How does vue pass the original data object in data into a method
習(xí)慣沉默
習(xí)慣沉默 2017-05-19 10:27:32
0
1
474

<template>

<p class="line">
  <p>{{ lists.valid_email }}</p>
  <p class="light_color" v-if="valided_email == 0">
    <input @focus="focus_email(show_email,valid_email)" @blur="blur_email" v-model="valid_email">
    <i v-show="show_email" class="iconfont icon-iconziti56"></i>
  </p>
  <p class="light_color" v-else>{{ valid_email }}</p>
</p>

</template>
<script>
export default {

data () {
  return {
    show_email : false,
    show_qq : false,
    show_wechat : false,
    }
},
props : [
  'valid_email',
  'qq',
  'wechat_id',
  'carInfo',
  'valided_email',
  'remark'
],
methods : {
  focus_email () {
    let length = this.valid_email.length;
    if(length >= 0){
      this.show_email = true
    }else {
      this.show_email = false
    }
  },

</script>
How to pass this.show_email into the focus_email method
Can writing like this achieve the effect of the method in methods
focus_email (name1,name2) {

    let length = this[name2].length;
    if(length >= 0){
      this[name1] = true
    }else {
      this[name1] = false
    }
  },
習(xí)慣沉默
習(xí)慣沉默

reply all(1)
小葫蘆

this.show_email 不需要作為參數(shù)傳入 focus_email, just use it directly.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template