uniapp-router-next
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -340,3 +340,3 @@ import type { App } from 'vue'; | ||
reLaunch(to: RouteLocationRaw): Promise<NavigationReturn>; | ||
navigateBack(delta?: RouteLocationRaw): Promise<NavigationReturn>; | ||
navigateBack(to?: RouteLocationBackRaw): Promise<NavigationReturn>; | ||
forceGuardEach(): Promise<NavigationReturn>; | ||
@@ -448,1 +448,16 @@ beforeEach(guard: NavigationGuard): void; | ||
export { } | ||
// extend vue | ||
declare module 'vue' { | ||
export interface ComponentCustomProperties { | ||
$uniRoute: RouteLocationNormalized | ||
$uniRouter: Router | ||
} | ||
export interface GlobalComponents { | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports | ||
RouterNavigate: import('vue').DefineComponent<{ | ||
to?: RouteLocationRaw | ||
navType?: 'navigate' | 'redirect' | 'reLaunch' | 'switchTab' | 'navigateBack' | ||
delta?: number | ||
}> | ||
} | ||
} |
{ | ||
"name": "uniapp-router-next", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "", | ||
@@ -43,2 +43,5 @@ "exports": { | ||
}, | ||
"peerDependencies": { | ||
"vue": "^3.2.45" | ||
}, | ||
"devDependencies": { | ||
@@ -58,9 +61,10 @@ "@dcloudio/types": "^3.3.3", | ||
"rollup-plugin-esbuild": "^5.0.0", | ||
"vue-router": "4", | ||
"vue": "^3.2.45" | ||
"vue": "^3.2.45", | ||
"vue-router": "4" | ||
}, | ||
"scripts": { | ||
"dev": "gulp --require @esbuild-kit/cjs-loader --gulpfile scripts/gulpfile.ts dev", | ||
"build": "gulp --require @esbuild-kit/cjs-loader --gulpfile scripts/gulpfile.ts build" | ||
"build": "gulp --require @esbuild-kit/cjs-loader --gulpfile scripts/gulpfile.ts build", | ||
"marge:globalExtensions": "tail -n +4 src/globalExtensions.ts >> js_sdk/index.d.ts" | ||
} | ||
} |
@@ -47,3 +47,2 @@ # uniapp-router-next | ||
import { createSSRApp } from 'vue' | ||
import RouterNavigate from 'uniapp-router-next/components/router-navigate/router-navigate.vue' | ||
import router from './router' | ||
@@ -53,3 +52,2 @@ import App from './App.vue' | ||
const app = createSSRApp(App) | ||
app.component('router-navigate', RouterNavigate) | ||
app.use(router) | ||
@@ -63,2 +61,34 @@ return { | ||
### 全局组册组件 | ||
有以下两种组册方式,选择一种即可,推荐`easycom`这种方式 | ||
- 在`main.ts`或`main.js`中组册 | ||
```js | ||
// main.ts | ||
import { createSSRApp } from 'vue' | ||
// 引入组件 | ||
import RouterNavigate from 'uniapp-router-next/components/router-navigate/router-navigate.vue' | ||
import router from './router' | ||
import App from './App.vue' | ||
export function createApp() { | ||
const app = createSSRApp(App) | ||
// 组册组件 | ||
app.component('router-navigate', RouterNavigate) | ||
app.use(router) | ||
return { | ||
app | ||
} | ||
} | ||
``` | ||
- 基于`uniapp`的`easycom`,在`pages.json`中添加以下代码 | ||
```json | ||
{ | ||
"easycom": { | ||
"custom": { | ||
"router-navigate": "uniapp-router-next/components/router-navigate/router-navigate.vue" | ||
} | ||
} | ||
} | ||
``` | ||
### api跳转 | ||
@@ -65,0 +95,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143385
3836
237
1