ItSolutionStuff.com

How to Open a Link in a New Tab in Vue JS?

By Hardik Savani • June 30, 2023
Vue.JS

Hi Friends,

In this example, you will learn vue js open new window. I explained simply about vue js open new tab. It's a simple example of vue js open link in new tab. you'll learn open new tab using vuejs. Let's get started with vue open link.

If you want to open url in new tab in vue js then i will help to give simple example of open link in new tab in vuejs. we will do using jquery window.open and "_blank" option so it open in new tab.

we will use simple jquery window for open new tab for url. bellow i give you full and simple example so you can simply copy html file and check how it works. let's see bellow example.

Example:

<!DOCTYPE html>

<html>

<head>

<title>Vue JS - Open link in new tab Example - ItSolutionStuff.com</title>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.5/vue.min.js"></script>

</head>

<body>

<div id="app">

<button @click="myFunction()">Click Me</button>

</div>

<script type="text/javascript">

new Vue({

el: '#app',

data: {

myModel:false

},

methods:{

myFunction: function () {

window.open("https://itsolutionstuff.com", "_blank");

}

}

});

</script>

</body>

</html>

I hope it can help you...

Tags: Vue.JS
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

Vue Js Sweetalert Modal Notification Example

Read Now →

Vue JS Toggle Switch Button Example

Read Now →

File Upload using Vue js Axios PHP Example

Read Now →

How to Create and Use Component in Vue JS Cli?

Read Now →

How to Replace String in Vue JS?

Read Now →

How to Use setTimeout Function in Vue JS?

Read Now →

How to Check Object or Array Empty or Not in Vue JS?

Read Now →

How to Get Element by ID in Vue JS?

Read Now →

Laravel Vue Router Example From Scratch

Read Now →

Laravel Vue Flash Message Example From Scratch

Read Now →

Laravel Vue JS File Upload Using Vue-dropzone Example

Read Now →

Laravel Vue JS Image Upload Example

Read Now →

Laravel Vue JS Axios Post Request Example

Read Now →