This time I will show you how to implement the dynamic parameter transfer of query in vue-router, and what are the things to note . The following is a practical case. Let’s take a look. .
I have been writing a project recently. In the process of writing the project, I always find problems of one kind or another. For example, how does the query in vue-router pass dynamic parameters? After some twists and turns, the problem was solved.The problem is described as follows:
I hope the url will be like this when jumping: http://localhost:8080/editmovie?id=****static, the url will always be: http://localhost:8080/editmovie?id=111
In fact, the id I need is Placed in a hidden element:
vue-routerDynamic ConfigurationIncoming parameter problem, and then I saw the following code:

{{el.tourism_name}} {{el.tog_line_id}}
{{el.address}}
I suddenly feel like I have an idea. The solution is as follows:
Bind the id of li to the id in the data, and then write the bound id in the query. That’s itexport default { name : 'Movie', data() { return { id : "" } }, methods: { getId () { var id = $('.hiden').eq(0).text(); console.log(id); } }, mounted() { this.id = $('.hiden').eq(0).text(); }, components : { Heade, Foot } }I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website! Recommended reading:
Use JS to detect computer configuration (with code)
How to customize the opening and closing of the vue project eslint verification
The above is the detailed content of How to implement dynamic parameter passing of query in vue-router. For more information, please follow other related articles on the PHP Chinese website!

Vue应用中遇到vue-router的错误“NavigationDuplicated:Avoidedredundantnavigationtocurrentlocation”–怎么解决?Vue.js作为快速而灵活的JavaScript框架在前端应用开发中越来越受欢迎。VueRouter是Vue.js的一个代码库,用于进行路由管理。然而,有时

在这篇文章中,我们将向你展示如何通过拖放在PowerQuery中对多列进行重新排序。通常,从各种来源导入数据时,列可能不是所需的顺序。重新排序列不仅允许您按照符合您的分析或报告需求的逻辑顺序排列它们,还可以提高数据的可读性,并加快过滤、排序和执行计算等任务。如何在Excel中重新排列多个列?在Excel中,重新排列列的方法有多种。您可以简单地选择列标题,然后将其拖动到所需位置。但是,当处理包含许多列的大表时,这种方法可能会变得繁琐。为了更高效地重新排列列,您可以使用增强查询编辑器。通过增强查询编

ReactQuery数据库插件:实现数据导入和导出的方法,需要具体代码示例随着ReactQuery在前端开发中的广泛应用,越来越多的开发者开始使用它来管理数据。而在实际开发中,我们经常需要将数据导出到本地文件或从本地文件导入数据到数据库中。为了更方便地实现这些功能,可以使用ReactQuery数据库插件。ReactQuery数据库插件提供了一系列方

在Vue应用中使用vue-router是一种常见的方式来实现路由控制。然而,在使用vue-router的时候,有时候会出现“Error:Failedtoresolveasynccomponent:xxx”的错误,这是由于异步组件加载错误导致的。在本文中,我们将探讨这个问题,并提供解决方案。理解异步组件加载原理在Vue中,组件可以被同步或异步地创建

在Vue应用中使用vue-router时,有时候会出现“Error:Avoidedredundantnavigationtocurrentlocation”的错误信息。这个错误信息的意思是“避免了到当前位置的冗余导航”,通常是因为重复点击了同一个链接或者使用了相同的路由路径导致的。那么,怎么解决这个问题呢?使用exact修饰符在定义router

Vue-Router:如何使用路由元信息来管理路由?简介:Vue-Router是Vue.js官方的路由管理器,它可以帮助我们快速构建单页应用程序(SPA)。除了常见的路由功能外,Vue-Router还支持使用路由元信息来管理和控制路由。路由元信息是可以附加到路由上的自定义属性,它可以帮助我们实现一些特殊的逻辑或者权限控制。一、什么是路由元信息?路由元信息是

最近我尝试在Vue应用中使用vue-router,但遇到了一个问题:“UncaughtTypeError:Cannotreadproperty'push'ofundefined”。这个问题的原因是什么,以及如何解决呢?首先,让我们了解一下vue-router。vue-router是Vue.js官方的路由管理插件,可以帮助我们构建单页应用(SPA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor

SublimeText3 English version
Recommended: Win version, supports code prompts!
