zoukankan      html  css  js  c++  java
  • mpvue 小程序常用的一些插件 路由跳转mpvue-router-patch,数据请求flyio,vuex

    路由跳转 mpvue-router-patch

    方法
    $router.push(location, onComplete?, onAbort?, onSuccess?)
    跳转到应用内的某个页面,mpvue.navigateTo、mpvue.switchTab 及 mpvue.reLaunch 均通过该方法实现,location 参数支持字符串及对象两种形式,跳转至 tabBar 页面或重启至某页面时必须以对象形式传入
    
    // 字符串
    router.push('/pages/news/detail')
     
    // 对象
    router.push({ path: '/pages/news/detail' })
     
    // 带查询参数,变成 /pages/news/detail?id=1
    router.push({ path: '/pages/news/detail', query: { id: 1 } })
     
    // 切换至 tabBar 页面
    router.push({ path: '/pages/news/list', isTab: true })
     
    // 重启至某页面,无需指定是否为 tabBar 页面,但 tabBar 页面无法携带参数
    router.push({ path: '/pages/news/list', reLaunch: true })
    $router.replace(location, onComplete?, onAbort?, onSuccess?)
    关闭当前页面,跳转到应用内的某个页面,相当于 mpvue.redirectTo,location 参数格式与 $router.push 相似,不支持 isTab 及 reLaunch 属性
    
    $router.go(n)
    关闭当前页面,返回上一页面或多级页面,n 为回退层数,默认值为 1
    
    $router.back()
    关闭当前页面,返回上一页面

    官网 :https://www.npmjs.com/package/mpvue-router-patch

    微信公众号:jingfeng18 免费学习领取最新的前端学习资源
  • 相关阅读:
    mysql show profiles 使用分析sql 性能
    面向对象三大特征---封装、继承、多态
    http_build_query用法,挺方便的
    请求数据
    多模匹配算法之Aho-Corasick
    php命名空间如何引入一个变量类名?
    MySQL错误:Can't connect to MySQL server (10060)
    Vim完全教程
    路由
    wireshark
  • 原文地址:https://www.cnblogs.com/qianduanshiping/p/11826845.html
Copyright © 2011-2022 走看看