Skip to main content
Version: v3

replace

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

Close the current page and jump to a page within the app.

Type

function replace(option: Option): void

Parameters

Option

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
urlstringY-path2.0
paramsstring|objectN-Parameters passed to the page onCreate lifecycle, supporting strings or standard JSON objects. If a standard JSON object is passed, the method internally converts it to a string2.0

Example

import { replace } from '@zos/router'

replace({
url: 'page/index',
params: 'type=1',
})