首先需要引入验证码的js:gVerify.zip

    1. <script src="js/gVerify.js"></script>

    代码如下:

    1. <input type="text" v-model='canvasYzm' style="width: 280px" placeholder="验证码"/>
    2. <div class="pull-right" id="v_container" style="width: 101px;height: 40px;"></div>

    初始化:

     mounted:function () {
          var that = this;
          that.verifyCode=new GVerify("v_container")//生成验证码
      }
    

    效果如下:
    1557151241(1).jpg