<template> <view> <page-head title="getCurrentPages"></page-head> <button @click="getCurrentPages">getCurrentPages</button> </view> </template> <script> export default { data() { return { checked: false, } }, methods: { getCurrentPages: function () { const pages = getCurrentPages() if (pages[0].route.includes('/tabBar/')) { this.checked = true } for (let i = 1; i < pages.length; i++) { if (pages[i].route.includes('/tabBar/')) { this.checked = false } } }, }, } </script>