Skip to content

makebin/ton.uni.navigate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

基于uniapp的 页面跳转lib

import uniNavigate from 'ton.uni.navigate';

// 定义页面接口
interface IPage {
  path: string;
  name: string;
  meta: {
    target: string;
  };
}

// 示例 pages 数组
const pages: IPage[] = [
  {
    path: '/home',
    name: 'HomePage',
    meta: {
      target: 'self'
    }
  },
  {
    path: '/about',
    name: 'AboutPage',
    meta: {
      target: 'blank'
    }
  }
];

// 创建导航实例
const handle = new uniNavigate(pages);

// 导航调用(可以是字符串或者页面对象)
handle.to('/home');
handle.to({
  path: '/about',
  name: 'AboutPage',
  meta: {
    target: 'blank'
  }
});

About

uniapp 页面跳转助手

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published