If you configure the routing of page jumps in the front-end and back-end separated version (vue)

Scenes

If you build a development environment and run the project in a separate version of the front and back ends:

https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/108465662

On this basis, if you want to add a button to a page, click this button to jump to a new page, and set it in the page

A new window page opens.

Note:

Blog:
https://blog.csdn.net/badao_liumang_qizhi
Follow the public
account Domineering
programmers Get programming-related e-books, tutorial pushes and free downloads.

achieve

First find index.js under router under the vue project

 

Then add the routing configuration

    {
        path: '/webclient',
        component: webclientlogin,
    },

The path above is the path when jumping, and the component below is the jumping component, so this component needs to be introduced

import webclientlogin from '@/views/system/webclient/webclientlogin'

Then add a button to the page you want to jump to

        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="webclientlogin"
        >Web版本</el-button>

In the click event of the button

    webclientlogin() {
        let routeData = this.$router.resolve({ path: '/webclient', query: {  id: 1 } });
        window.open(routeData.href, '_blank');
    },

If you need to pass parameters, add query, if you don’t need it, don’t pass it.

It will open in a new window page.

Guess you like

Origin blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/114641133