Skip to main content
formatting
Source Link
cjmling
  • 7.3k
  • 11
  • 50
  • 83

i prefer to create folder his name is Utils and inside create page index that contain what that think you helper by

 const findByAttr const= findByAttr=(component,attr) => { const wrapper=component.find(`[data-test='${attr}']`);  return wrapper; }    const FUNCTION_NAME=FUNCTION_NAME = (component,attr) => { const wrapper=component.find(`[data-test='${attr}']`);  return wrapper; }   export {findByAttr, FUNCTION_NAME} 

When you need to use this it should be imported as use "{}" because you did not use the default keyword look

 import {FUNCTION_NAME,findByAttr} from'.whare file is store/utils/index' 

i prefer to create folder his name is Utils and inside create page index that contain what that think you helper by

  const findByAttr=(component,attr)=>{ const wrapper=component.find(`[data-test='${attr}']`); return wrapper; }  const FUNCTION_NAME=(component,attr)=>{ const wrapper=component.find(`[data-test='${attr}']`); return wrapper; } export{findByAttr,FUNCTION_NAME} 

When you need to use this it should be imported as use "{}" because you did not use the default keyword look

 import {FUNCTION_NAME,findByAttr} from'.whare file is store/utils/index' 

i prefer to create folder his name is Utils and inside create page index that contain what that think you helper by

const findByAttr = (component,attr) => { const wrapper=component.find(`[data-test='${attr}']`);  return wrapper; }   const FUNCTION_NAME = (component,attr) => { const wrapper=component.find(`[data-test='${attr}']`);  return wrapper; }   export {findByAttr, FUNCTION_NAME} 

When you need to use this it should be imported as use "{}" because you did not use the default keyword look

 import {FUNCTION_NAME,findByAttr} from'.whare file is store/utils/index' 
Source Link

i prefer to create folder his name is Utils and inside create page index that contain what that think you helper by

 const findByAttr=(component,attr)=>{ const wrapper=component.find(`[data-test='${attr}']`); return wrapper; } const FUNCTION_NAME=(component,attr)=>{ const wrapper=component.find(`[data-test='${attr}']`); return wrapper; } export{findByAttr,FUNCTION_NAME} 

When you need to use this it should be imported as use "{}" because you did not use the default keyword look

 import {FUNCTION_NAME,findByAttr} from'.whare file is store/utils/index'