showContacts.vue 1.17 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<script>
export default {
  name: "showContacts",
  props:{
    phoneString:[String]
  },
  data(){
    return {
      phoneList:[],
      show:false
    }
  },
  mounted() {
    let phone = this.phoneString
    this.phoneList = phone.split('(;)');
  }
}
</script>

<template>
<div>
  <el-dialog :modal-append-to-body="false" :append-to-body="true" :visible.sync="show">
    <div v-for="(item, index) in phoneList" :key="index" >
      <div>
        <span>联系人{{index + 1}}</span>
        <span>{{item.split('(@)')[1]}}</span>
      </div>
      <div>
        <span>联系电话{{index + 1}}</span>
        <span>{{item.split('(@)')[0]}}</span>
      </div>
    </div>
  </el-dialog>
   <div>
    <div>
      <span>联系人:</span>
      <span>{{phoneList[0] ? phoneList[0].split('(@)')[1] : ''}}</span>
    </div>
     <div style="white-space: normal;">
       <span>联系电话:</span>
       <span>{{phoneList[0] ? phoneList[0].split('(@)')[0] : ''}}</span>
        <el-button v-if="phoneList.length > 1" @click="show = true;" style="margin-left: 10px;" size="mini" type="text" >更多</el-button>
     </div>
   </div>
</div>
</template>

<style scoped lang="scss">

</style>