当前位置:网站首页>Solve the problem that uni app applet obtains routes and route parameters
Solve the problem that uni app applet obtains routes and route parameters
2022-07-25 05:00:00 【Like angels】
solve uni-app The applet inside gets the current route and route parameters
stay uni-appH5 The client can get the route and parameters of the current page , But the small program began to report errors :
Code :
this.type = this.$route.query.type // obtain type Parameters carried
Error reported in applet :
Solution :
// Get the instance of the current page stack , Given as an array in the order of stacks , The first element is the home page , The last element is the current page
let pages = getCurrentPages();
let page = pages[pages.length - 1].$page.fullPath; // Full routing address
this.type = page.split('type=')[1] // Carry the type Parameters
Thank you for reading, your likes and favorites are the biggest motivation for my creation
边栏推荐
- Your technical leader doesn't understand this? Without it, there is no complete thinking process of design
- 如何判断是否遭到DDOS攻击
- The strongest JVM in the whole network is coming!
- Very clear organization
- Natural state is the best
- 85 distributed project construction
- Openworm project compilation
- Libenent and libev
- Druid connection pool - strong self-study from 0. Those who don't understand Druid can click in. If you know not to click in, you will think I'm wordy
- Novel capture practice
猜你喜欢
![[no title] 1](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[no title] 1
![Introduction to fundamentals of operations research [1]](/img/79/b613bff74a78ad63f202b9e652220d.png)
Introduction to fundamentals of operations research [1]

Teach you three ways to optimize the performance from 20s to 500ms

Basic knowledge of scratch crawler framework

When image component in wechat applet is used as background picture
Set up private CA server

Permanent magnet synchronous motor 36 question (1) -- what is the difference between salient pole motor and salient pole motor?

85 distributed project construction

Why does the official not recommend using UUID as MySQL primary key

Salt and ice particles cannot be distinguished
随机推荐
Valley p2420 let's XOR solution
Ownership in rust -- introduction of rust language Xiaobai 11
推荐系统-协同过滤在Spark中的实现
绕过 Web 应用程序中的 XSS 过滤器
Paper:《Peeking Inside the Black Box: Visualizing Statistical Learning with Plots of Individual Condi
【基于stm32f103的SHT30温湿度显示】
ESWC 2018 | R-GCN:基于图卷积网络的关系数据建模
[analysis of GPIO register (crl/crh) configuration of STM32]
市场是对的
Summary and Prospect of aut, the transport layer protocol of sound network -- dev for dev column
[sht30 temperature and humidity display based on STM32F103]
Druid connection pool - strong self-study from 0. Those who don't understand Druid can click in. If you know not to click in, you will think I'm wordy
Gbase JDBC connection database exception
[CTF learning] steganography set in CTF -- picture steganography
STM32 Development Notes 118: using CMSIS DSP Library in stm32cube IDE
【微信小程序】拍卖商品详情页设计与交互实现(包含倒计时、实时更新出价)
Permanent magnet synchronous motor 36 question (1) -- what is the difference between salient pole motor and salient pole motor?
5年经验的大厂测试/开发程序员,怎样突破技术瓶颈?大厂通病......
STM32 development note 117: generate IIR low-pass filter coefficients using MATLAB
How can I check if the number of RDS links in MySQL suddenly rises?