2929</template >
3030
3131<script >
32- import  { keepScanning  } from  ' ../misc/scanner.js' 
33- import  { thinSquare  } from  ' ../misc/track-func.js' 
34- import  Camera  from  ' ../misc/camera.js' 
35- import  CommonAPI  from  ' ../mixins/CommonAPI.vue' 
36- import  isEqual  from  ' lodash/isEqual' 
37- import  isBoolean  from  ' lodash/isBoolean' 
38- import  isObject  from  ' lodash/isObject' 
39- import  stubObject  from  ' lodash/stubObject' 
32+ import  { keepScanning  } from  " ../misc/scanner.js" ; 
33+ import  { thinSquare  } from  " ../misc/track-func.js" ; 
34+ import  Camera  from  " ../misc/camera.js" ; 
35+ import  CommonAPI  from  " ../mixins/CommonAPI.vue" ; 
36+ import  isEqual  from  " lodash/isEqual" ; 
37+ import  isBoolean  from  " lodash/isBoolean" ; 
38+ import  isObject  from  " lodash/isObject" ; 
39+ import  stubObject  from  " lodash/stubObject" ; 
4040
4141export  default  {
4242  mixins:  [CommonAPI], 
@@ -49,7 +49,7 @@ export default {
4949
5050    camera:  { 
5151      type:  [Object , Boolean ], 
52-       default:  stubObject,  
52+       default:  stubObject 
5353    }, 
5454
5555    track:  { 
@@ -63,8 +63,8 @@ export default {
6363      cameraInstance:  null , 
6464      destroyed:  false , 
6565      constraints:  {}, 
66-       stopScanning :  () =>  {},  
67-     } 
66+       stopScanning :  () =>  {} 
67+     };  
6868  }, 
6969
7070  computed:  { 
@@ -73,6 +73,7 @@ export default {
7373        this .paused  ===  false  &&  
7474        this .destroyed  ===  false  &&  
7575        this .constraints .video  !==  false  
76+       ); 
7677    }, 
7778
7879    shouldScan () { 
@@ -99,8 +100,7 @@ export default {
99100      } else  { 
100101        return  this .track ; 
101102      } 
102-     }, 
103- 
103+     } 
104104  }, 
105105
106106  watch:  { 
@@ -125,36 +125,36 @@ export default {
125125      deep:  true , 
126126      immediate:  true , 
127127
128-       handler   (camera , oldValue ) { 
129-         const  deeplyEqual  =  isEqual (camera, oldValue) 
128+       handler (camera , oldValue ) { 
129+         const  deeplyEqual  =  isEqual (camera, oldValue);  
130130
131131        if  (deeplyEqual) { 
132132          //  object reference changed but constraints are actually the same 
133-           return  
133+           return ;  
134134        } else  if  (isBoolean (camera)) { 
135135          this .constraints  =  { 
136136            audio:  false , 
137-             video:  camera,  
138-           } 
137+             video:  camera 
138+           };  
139139        } else  if  (isObject (camera)) { 
140140          this .constraints  =  { 
141141            audio:  false , 
142142            video:  { 
143-               facingMode:  { ideal:  ' environment'   }, 
143+               facingMode:  { ideal:  " environment"   }, 
144144              width:  { min:  360 , ideal:  640 , max:  1920  }, 
145145              height:  { min:  240 , ideal:  480 , max:  1080  }, 
146146
147147              //  overrides properties above if given 
148-               ... camera,  
149-             },  
150-           } 
148+               ... camera 
149+             } 
150+           };  
151151        } 
152-       },  
152+       } 
153153    }, 
154154
155-     constraints   () { 
156-       this .$emit (' init'  , this .init ()) 
157-     },  
155+     constraints () { 
156+       this .$emit (" init"  , this .init ());  
157+     } 
158158  }, 
159159
160160  mounted () { 
@@ -172,7 +172,7 @@ export default {
172172      this .beforeResetCamera (); 
173173
174174      if  (this .constraints .video  ===  false ) { 
175-         this .cameraInstance  =  null  
175+         this .cameraInstance  =  null ;  
176176      } else  { 
177177        this .cameraInstance  =  await  Camera (this .constraints , this .$refs .video ); 
178178
@@ -187,10 +187,8 @@ export default {
187187
188188    startScanning () { 
189189      const  detectHandler  =  result  =>  { 
190-         this .onDetect ( 
191-           Promise .resolve ({ source:  ' stream'  , ... result }) 
192-         ) 
193-       } 
190+         this .onDetect (Promise .resolve ({ source:  " stream"  , ... result })); 
191+       }; 
194192
195193      //  this.stopScanning() 
196194      this .stopScanning  =  keepScanning (this .cameraInstance , { 
0 commit comments