
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
mutants-mobile-navigator
Advanced tools
import {TopNavPage} from 'mutants-mobile-navigator';
@TopNavPage
class Test extends React.Component<object,object>{
/**
* 头部导航栏相关-可重写的方法
*/
//是否显示导航栏 默认显示
navShow(){
return true;
}
//设置标题
navTitle(){
return 'test';
}
//是否显示回退图标 默认显示
navLeftIcon(){
return true;
}
//回退事件
navLeftClick(){
const returnValue = await new Promise(function (resolve) {
alert('温馨提示', '您确定要退出此应用?', [
{ text: '取消', onPress: () => resolve(false) },
{ text: '确定', onPress: () => resolve(true) },
])
});
if(returnValue){
this.pop();
}
}
//是否显示关闭按钮 默认 history.length > 1?true:false;
navCloseShow(){
}
/**
* 导航相关 可直接调用
*/
testPush = ()=>{
this.push(pagePath, pageParams);
}
testReplace = ()=>{
this.replace(pagePath, pageParams);
}
testPop = ()=>{
this.pop(); //如果栈里只有一个元素,直接closeApp
}
testPageParam = ()=>{
console.log('从前一页面传递过来的参数',this.pageParam());
}
//打开新页面,获取值,返回后调用pageBackReceiveResult
testPushForResult = (pagePath, pageParams = {})=>{
this.push(pagePath,pageParams);
}
//action 返回的key ,result 返回结果
pageBackReceiveResult(action, result) {
console.log('action === result=====',action,result);
}
//关闭回传值时调用
testPopAndReturn(action, result) {
this.popAndReturn(action,result);
}
}
非页面组件,无法使用TopNavPage包裹,在普通组件中完成跳转管理
import {NavUtils} from 'mutants-mobile-navigator';
//跳转到新页面取值
NavUtils.pushForResult('second',{source:'index'},(action,result)=>{
console.log('action === result=====',action,result);
});
//关闭页面并返回值 backResultKey可从pageParam中获取
NavUtils.popAndReturn('backResult',{content:'hello world'},pageParam.backResultKey);
//如果栈里只有一个元素,直接closeApp
NavUtils.pop();
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.