Home > Net >  Redirect to external URL on click in VUE.JS
Redirect to external URL on click in VUE.JS

Time:08-09

      <h3 :
        @click="game.gameAchievements = false, game.gameCreation = false, enJin.audioController.play('take')"
        @mouseenter="enJin.audioController.play('cardHover')">Desktop App</h3>

I have the issue, that I somehow cannot get this button to a external webpage. I already tried basic things like this.$router.push.

CodePudding user response:

For exemple in Vuejs3 you can

const redirect = () => {
  window.location.href="https://some-url.com"
}

And add this function into @click on your HTML element

<button @click="redirect()">
  Redirect
</button>
  • Related