18 lines
377 B
JavaScript
18 lines
377 B
JavaScript
import { defineStore } from 'pinia'
|
|
import {ref} from "vue";
|
|
|
|
export const useScanCodeStore = defineStore('scancode', ()=>{
|
|
const type=ref('');
|
|
const code=ref([]);
|
|
const clearCode=(data)=>{
|
|
type.value='';
|
|
code.value=[];
|
|
}
|
|
const addCode=(data, intype)=>{
|
|
type.value = intype;
|
|
code.value.push(data);
|
|
}
|
|
return{ code, type, clearCode, addCode};
|
|
},{
|
|
persist: true
|
|
}) |