一 Css 样式
<div class="form-group" >
<div>
<span>验证码:</span>
<input type="text" id="code" v-model="code" class="code" placeholder="请输入您的验证码" />
</div>
<div class="login-code" @click="refreshCode">
<!--验证码组件-->
<s-identify :identifyCode="identifyCode"></s-identify>
</div>
</div>
二 js引入验证码组件 定义三个变量
import SIdentify from '../components/sidentify'
components: { SIdentify },
data () {
return {
identifyCodes: "1234567890",