const canNavBack = getCurrentPages() export function useGoBack() { /** * 返回 */ const goBack = () => { if( canNavBack && canNavBack.length>1) { uni.navigateBack() } else { history.back(); } } return { goBack } }