feat:扫描组件
This commit is contained in:
parent
42760326b8
commit
b56a06d5e6
|
|
@ -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>
|
||||||
Loading…
Reference in New Issue