feat:扫描组件

This commit is contained in:
shijing 2024-10-24 17:16:44 +08:00
parent 42760326b8
commit b56a06d5e6
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
<template>
<div>
<el-button type="primary" @click="open" style="margin-left: 10px;">扫码添加</el-button>
<el-dialog
title="扫描二维码"
v-model="visible"
destroy-on-close
>
<el-input
ref="codeInput"
v-model="codeText"
clearable
@change="$emit('closed',codeText)"
></el-input>
</el-dialog>
</div>
</template>
<script>
export default {
data(){
return{
visible:false,
codeText:''
}
},
methods:{
open(){
this.codeText = '';
this.visible = true;
setTimeout(() => {
this.$refs.codeInput.focus();
}, 200);
return this;
},
closed(){
this.visible = false;
}
}
}
</script>