Vue.js与window.addEventListener等效的方法('load',function()

时间:2018-03-29 17:24:13

标签: vue.js

在compoent scripy中我有以下函数,我可以在created()或mount()中设置等效函数吗?

 window.addEventListener('load', function () {
   mode = router.currentRoute.query.mode
   actionCode = router.currentRoute.query.oobCode
  // apiKey = router.currentRoute.query.apiKey
   continueUrl = router.currentRoute.query.continueUrl
   switch (mode) {
     case 'resetPassword':
       // handleResetPassword(actionCode, continueUrl)
       break
     case 'recoverEmail':
       // handleRecoverEmail(actionCode)
       break
     case 'verifyEmail':
       handleVerifyEmail(actionCode, continueUrl)
       break
     default:
       console.log('ERROR mode: ', mode)
       // Error: invalid mode.
   }
 })

并设置handleVerifyEmail(actionCode,continueUrl)函数作为方法??

感谢您的反馈

0 个答案:

没有答案