在src/view/login/index.vue中使用组件
<Verify
:type="5"
:show-button="false"
:img-name="['1.png','2.png','3.png','4.png','5.png', '6.png','7.png', '8.png']"
:img-url="'../../static/img/verify/'"
@success="verifySuccess"
@error="verifyError"
/>
imgUrl背景图片的地址,不设置默认是:'images/'
新的vue项目有pulic文件,如果我们的项目是有pulic那么可以把图片放在如下图所在的文件夹:
设置为'../../static/img/verify/'(根据调用组件的页面来设置路径)
旧版vue项目 在src/App.vue中使用组件
<Verify @success="alert"
@error="alert('error')"
:type="5"
:img-name="['1.png','2.png','3.png','4.png','5.png', '6.png','7.png', '8.png']"
:img-url="'../static/image/verify/'"></Verify>
旧版vue项目的是staic文件夹
设置为'../../static/image/verify/'(根据调用组件的页面来设置路径)