I'm having trouble with calling a function and opening a new tab in my VueJS application. Here is an example of what I want to do:
const someFunction = async () => {
const value = await api.someCallToApi();
window.open('https://example.com', '_blank').focus();
}
However, it seems like I can't do this because the window.open is not directly caused by a user action due to the use of await. The order of the api call and opening of the new tab matters for my application's functionality.
Is there a modern and effective alternative approach to solving this issue?