如何使用quasar使用名字和姓氏自动生成名称

时间:2017-10-17 11:41:43

标签: vue.js quasar-framework

这里我有两个名字,名字和名字姓。如何使用名字和姓氏自动生成不同的名称  (例如:firstname.lastname或firstname_lastname)

<q-input name="firstname" v-model="first" float-label="First name"
 v-validate="'required|alpha_spaces'" clearable/>
            <i v-show="errors.has('firstname')" class="fa fa-warning "></i>
            <div class="containerError">   
               <span v-show="errors.has('firstname')" class="text-negative text-right">{{ errors.first('firstname') }}</span>
            </div>

<q-input name="lastname" required="required" v-model="last" float-label="Last name" v-validate="'required|alpha_spaces'" clearable />
            <i v-show="errors.has('lasttname')" class="fa fa-warning "></i>
            <div class="containerError">    <span v-show="errors.has('lastname')" class="text-negative text-right">{{ errors.first('lastname') }}</span>
            </div>

1 个答案:

答案 0 :(得分:0)

<template>
            <div v-if="this.last != ''"  float-label="fullname">
            User-name :{ {this.first}}.{{this.last}}  
            </div>
</template>