We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/src/components/fg-tabbar/fg-tabbar.vue
建议在这里优化下代码 原代码: function selectTabBar({ value: index }: { value: number }) { // const url = tabbarList[index].path // tabbarStore.setCurIdx(index) // uni.switchTab({ url }) doSelTabBar(index) } const doSelTabBar = (index: number) => { const url = tabbarList[index].path tabbarStore.setCurIdx(index) uni.switchTab({ url }) } onLoad(() => { // 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题 // #ifdef APP-PLUS | H5 uni.hideTabBar({ fail(err) { console.log('hideTabBar fail: ', err) }, success(res) { console.log('hideTabBar success: ', res) }, }) // #endif // add by xmvigour 重新进入的时候进入上一次的tab if (tabbarStore.curIdx > 0) { // selectTabBar(tabbarStore.curIdx) doSelTabBar(tabbarStore.curIdx) console.log('tabbarStore.curIdx', tabbarStore.curIdx) } })
function selectTabBar({ value: index }: { value: number }) { // const url = tabbarList[index].path // tabbarStore.setCurIdx(index) // uni.switchTab({ url }) doSelTabBar(index) } const doSelTabBar = (index: number) => { const url = tabbarList[index].path tabbarStore.setCurIdx(index) uni.switchTab({ url }) } onLoad(() => { // 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题 // #ifdef APP-PLUS | H5 uni.hideTabBar({ fail(err) { console.log('hideTabBar fail: ', err) }, success(res) { console.log('hideTabBar success: ', res) }, }) // #endif // add by xmvigour 重新进入的时候进入上一次的tab if (tabbarStore.curIdx > 0) { // selectTabBar(tabbarStore.curIdx) doSelTabBar(tabbarStore.curIdx) console.log('tabbarStore.curIdx', tabbarStore.curIdx) } })
改完以后:(onload坐一下判断 ) function selectTabBar({ value: index }: { value: number }) { // const url = tabbarList[index].path // tabbarStore.setCurIdx(index) // uni.switchTab({ url }) doSelTabBar(index) } const doSelTabBar = (index: number) => { const url = tabbarList[index].path tabbarStore.setCurIdx(index) uni.switchTab({ url }) } onLoad(() => { // 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题 // #ifdef APP-PLUS | H5 uni.hideTabBar({ fail(err) { console.log('hideTabBar fail: ', err) }, success(res) { console.log('hideTabBar success: ', res) }, }) // #endif // add by xmvigour 重新进入的时候进入上一次的tab if (tabbarStore.curIdx > 0) { // selectTabBar(tabbarStore.curIdx) doSelTabBar(tabbarStore.curIdx) console.log('tabbarStore.curIdx', tabbarStore.curIdx) } })
The text was updated successfully, but these errors were encountered:
兄弟,提个PR 吧,新仓库用 codercup2/unibest, 在新仓库里面提。
Sorry, something went wrong.
No branches or pull requests
/src/components/fg-tabbar/fg-tabbar.vue
建议在这里优化下代码
原代码:
function selectTabBar({ value: index }: { value: number }) { // const url = tabbarList[index].path // tabbarStore.setCurIdx(index) // uni.switchTab({ url }) doSelTabBar(index) } const doSelTabBar = (index: number) => { const url = tabbarList[index].path tabbarStore.setCurIdx(index) uni.switchTab({ url }) } onLoad(() => { // 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题 // #ifdef APP-PLUS | H5 uni.hideTabBar({ fail(err) { console.log('hideTabBar fail: ', err) }, success(res) { console.log('hideTabBar success: ', res) }, }) // #endif // add by xmvigour 重新进入的时候进入上一次的tab if (tabbarStore.curIdx > 0) { // selectTabBar(tabbarStore.curIdx) doSelTabBar(tabbarStore.curIdx) console.log('tabbarStore.curIdx', tabbarStore.curIdx) } })
改完以后:(onload坐一下判断 )
function selectTabBar({ value: index }: { value: number }) { // const url = tabbarList[index].path // tabbarStore.setCurIdx(index) // uni.switchTab({ url }) doSelTabBar(index) } const doSelTabBar = (index: number) => { const url = tabbarList[index].path tabbarStore.setCurIdx(index) uni.switchTab({ url }) } onLoad(() => { // 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题 // #ifdef APP-PLUS | H5 uni.hideTabBar({ fail(err) { console.log('hideTabBar fail: ', err) }, success(res) { console.log('hideTabBar success: ', res) }, }) // #endif // add by xmvigour 重新进入的时候进入上一次的tab if (tabbarStore.curIdx > 0) { // selectTabBar(tabbarStore.curIdx) doSelTabBar(tabbarStore.curIdx) console.log('tabbarStore.curIdx', tabbarStore.curIdx) } })
The text was updated successfully, but these errors were encountered: