Answer the question
In order to leave comments, you need to log in
How to implement an external link confirmation page in a single page application with Vue.js?
The blog is written in Vue.js. Blog posts will contain links to external resources. You need to make a page that will contain the following information:
"You are following an external link. If you do not want to wait, then click here. If you do not want to go, then click there, otherwise after 10 seconds you will go there automatically."
The text of the post in the editor is formatted using the BB code, which is then translated into html tags. External links take the form of text .
Here is an excerpt from the function that translates the BB code into html tags:
// BB-код
$in = array(
...
'/\[url\="?(.*?)"?\](.*?)\[\/url\]/ms',
...
);
// html-теги
$out = array(
...
'<a href="#/go/\1">\2</a>',
...
);
$text = preg_replace($in, $out, $text);
{ path: '/go/:p1/:p2/:p3/:p4/:p5/:p6/:p7/:p8/:p9/:p10', component: AppGoAway },
{ path: '/go/:link', component: AppGoAway },
{ path: '/go/', component: AppGoAway },
{ path: '*', component: App404 }
Answer the question
In order to leave comments, you need to log in
But you can’t do it
, but check $route.query in the AppGoAway component and, in general, fix $route? /go?link=http://elsewhere.com/blalba
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question