Sponsored Content
Top Forums Web Development Simple Vue.js Component to Redirect to External Web Page Using Vue Router Post 303031806 by Neo on Wednesday 6th of March 2019 04:18:33 AM
Old 03-06-2019
Simple Vue.js Component to Redirect to External Web Page Using Vue Router

Vue Router has some quirks and on of the quirks is that it is not reliable when adding external links using the vue-router library.

After struggling with many solutions, I have found that creating a simple Vue.js component like this one seems to work the best (so far):

Component Example: RedirectNotes.vue

Code:
<template>
  <div class="d-flex justify-content-around" style="padding:20px" v-if="redirect()">
    <div>
      <h3>This Vue Component Does a Basic Redirect</h3>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    redirect() {
      var url = "https://www.unix.com/usernote.php";
      this.$router.push({ path: "/dashboard" });
      window.open(url, "_target");
    }
  }
};
</script>

<style>
</style>

Naturally the entries is routes.js are simple:

Code:
const RedirectNotes = () => import("src/pages/vB/RedirectNotes.vue");

Code:
   
       {
        path: "usernotes",
        name: "User Notes",
        components: { default: RedirectNotes }
      },

This is not the best method, but it is the only method that works consistently in vue-router so far.

The downside is that some browsers may block the new window and the user will need to grant permissions.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to redirect to a web-page by shell script

Dear all, I am calling a korn shell script(CGI script) by a web-page. This shell script do some checking in a unix file and return true or false. Now within the same script, If it returns true then I want to redirect to another web-page stored in htdocs directory. Example: Login page sends a... (3 Replies)
Discussion started by: ravi18s
3 Replies

2. Web Development

A Simple Way to Set Meta Tags Using Vue.js

Did a lot of searching on the net and found a lot of tricky ways and Vue.js libs to set meta tags, but I wanted sometime simpler. So, given this standard HTML: <head> <title>Page Title</title> <meta name="description" content="Page Description"> <meta name="keywords" content="Page... (0 Replies)
Discussion started by: Neo
0 Replies

3. Web Development

A simple UNIXtime component in Vue.js

A shout out to Scott who gave me a helping hand to turn a simple sample Vue.js app I wrote yesterday into a Vue.js component: Vue.component("unix-time", { template: `<div class="time">{{unixtime}}</div>`, data() { return { unixtime: "" }; }, methods: { ... (1 Reply)
Discussion started by: Neo
1 Replies

4. Web Development

Some Thoughts on Vue.js at UNIX.com

Recently, have been learning Vue and, as always, learning-by-doing, which means writing code for real-world applications. In this process, I have learned something that is not really mentioned in the majority of online Vue tutorials. Basically, when you create a Vue instance in your browser,... (0 Replies)
Discussion started by: Neo
0 Replies

5. Web Development

MySQL Query to Build Mockup Vue.js UserCP Timeline Page

Here is the query (and some sample results) I plan to use to build a new timeline page in the mockup vue.js usercp I am working on. When the postid is the same as lastpostid, this means the timeline entry will be - "{{Member}} Started Discussion {{Thread Title}} at {{date and time}}" and when... (4 Replies)
Discussion started by: Neo
4 Replies

6. Web Development

Vue JS 2 Tutorial by The Net Ninja: A Recommended Vue.js Video Tutorial Series

A number of people have asked me how to get started with Vue.js and my reply before today was to Google "Vue.js". That has changed and my recommendation to anyone who wants to learn the fastest growing, easiest to learn and use Vue.js web dev framework is to watch this video tutorial series: ... (0 Replies)
Discussion started by: Neo
0 Replies

7. Web Development

Vue.js Steam Chat

This Vue.js chat component installed easily: npm i --save vue-steam-chat I was able to set it up and change the background color in the component css file to match the forums in seconds: https://www.unix.com/members/1-albums225-picture1162.png <template> <div style="height: 600px;... (17 Replies)
Discussion started by: Neo
17 Replies

8. Web Development

Web development learning thread(Javascript, HTML, CSS, angular, vue.js).

Hello All, After getting inspired from Neo, I have started a bit of JS learning these days. Whenever I learn something I will try to post it here(as of now my learning is NOT exactly bookish where I am going chapter by chapter etc, it could be more like small-small project vice kind of), I... (25 Replies)
Discussion started by: RavinderSingh13
25 Replies

9. Web Development

The State of Vue.js

Here is very good video from Evan You, founder of Vue.js, on the state of Vue.js State of Vuenation with Evan You Here is a nice PDF report on Vue.js Update State of Vue.js Report Vue.js is now the second most starred project on GitHub, recently surpassing Bootstrap. These two... (0 Replies)
Discussion started by: Neo
0 Replies

10. Web Development

Vue.js component: Beautiful code highlighter

Sooner than later I will render forum discussions in Vue.js to complement the standard way of showing forum threads. Today, I ran across this component, vue-code-highlight Beautiful code syntax highlighting as Vue.js component. https://www.unix.com/members/1-albums225-picture1199.jpg ... (1 Reply)
Discussion started by: Neo
1 Replies
ospf_monitor(8) 					      System Manager's Manual						   ospf_monitor(8)

NAME
ospf_monitor - Monitors OSPF gateways SYNOPSIS
/usr/sbin/ospf_monitor mon_db_file DESCRIPTION
The ospf_monitor command enables you to query OSPF routers to obtain detailed information on IO statistics, error logs, link-state data bases, AS external data bases, the OSPF routing table, configured OSPF interfaces, and OSPF neighbors. The ospf_monitor command operates in interactive mode. The Mon_db_file file is the complete pathname of a database composed of records configuring destinations for ospf_monitor remote commands. Each destination record is a single-line entry which lists the destination IP address, the destination host name, and an OSPF authentica- tion key (if authentication is activated by the destination). Since authentication keys may be present in the destination records, it is recommended that general access to this database be restricted. Refer to RFC-1583 (OSPF Specification, version 2) for details about OSPF database and packet formats. COMMANDS
Upon entering interactive mode, ospf_monitor presents the of ospf_monitor's interactive commands. Interactive commands can be interrupted at any time by a keyboard interrupt. Note that the command line length must be less than 200 characters. Local Commands Displays all local commands and their functions. Displays all remote commands and their functions. Displays all configured destinations. This command displays dest_index , the IP address, and the hostname of all potential ospf_monitor command destinations configured in mon_db_file. Displays the command history buffer showing the last 30 interactive commands. Exits the ospf_monitor program. Sends remote_command to the same (previous) destination. Sends remote_command to configured destination dest_index. Sends all ospf_monitor out- put to filename. Sends all ospf_monitor output to stdout. Remote Commands Displays link state advertisement. The OSPF area for which the query is directed. Specifies the one of the following type of advertise- ment to request: Requests the router links advertisements. They describe the collected states of the router's interfaces. For this type of request, the ls_id field should be set to the originating router's Router ID. Requests the network links advertisements. They describe the set of routers attached to the network. For this type of request, the ls_id field should be set to the IP interface address of the network's Designated Router. Requests the summary link advertisements describing routes to networks. They describe inter-area routes, and enable the condensing of routing information at area borders. For this type of request, the ls_id field should be set to the destination network's IP address. Requests the summary link advertisements describing routes to AS boundary routers. They describe inter-area routes, and enable the condensing of routing information at area borders. For this type of request, the ls_id field should be set to the Router ID of the described AS boundary router. Requests the AS external link advertisements. They describe routes to destinations external to the Autonomous System. For this type of request, the ls_id field should be set to the destination network's IP address. The router-id of the router that originated this link state advertisement. Displays cumulative log. This log includes input/output statistics for monitor request, hello, data base description, link-state request, link-state update, and link-state ack packets. Area statistics are provided which describe the total number of routing neighbors and number of active OSPF interfaces. Routing table statistics are summarized and reported as the number of intra-area routes, inter-area routes, and AS external data base entries. Displays cumulative errors. This log reports the various error conditions which can occur between OSPF routing neighbors and shows the number of occurrences for each. Displays the next hop list. This is a list of valid next hops mostly derived from the SPF calculation. Displays the link-state database (except for ASE's). This table describes the routers and networks making up the AS. If retrans is non-zero, the retransmit list of neighbors held by this lsdb structure will be printed. Displays the AS external data base entries. This table reports the advertising router, forwarding address, age, length, sequence number, type, and metric for each AS external route. If retrans is non-zero, the retransmit list of neigh- bors held by this lsdb structure will be printed. Displays the OSPF routing table. This table reports the AS border routes, area border routes, summary AS border routes, networks, summary networks and AS external networks currently managed via OSPF. If which is omitted, all of the above will be listed. If specified, the value of which (between 1 and 63) specifies that only certain tables should be displayed. The appropriate value is determined by adding up the values for the desired tables from the following list: Routes to AS border routers in this area. Routes to area border routers for this area. Summary routes to AS border routers in other areas. Routes to networks in this area. Summary routes to networks in other areas. AS routes to non-OSPF networks. Displays all interfaces. This report shows all inter- faces configured for OSPF. Information reported includes the area, interface IP address, interface type, interface state, cost, priority, and the IP address of the DR and BDR for the network. Displays all OSPF routing neighbors. Information reported includes the area, local interface address, router ID, neighbor IP address, state, and mode. Displays gated version information. RELATED INFORMATION
Commands: gated(8), gdc(8), ripquery(8), routed(8), delim off ospf_monitor(8)
All times are GMT -4. The time now is 03:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy