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
参考: https://router.vuejs.org/zh/guide/advanced/navigation-guards.html#全局前置守卫
一个自用的方法,能够使小程序代码接近H5原本的vue生态,仅供讨论:
import { createApp } from 'vue'; const App = createApp({}); export default App;
import { createRouter, createWebHistory } from 'vue-router'; const router = createRouter({ history: createWebHistory(), routes: [ { path: '/pages/device/index', name: 'device', }, ], }); router.beforeEach((to) => { wx.navigateTo({ url: to.href }); return false; }); App.use(router);
import { useRouter } from 'vue-router'; const router = useRouter(); router.push({ name: 'device', query: { serial: serialNumber, }, });
The text was updated successfully, but these errors were encountered:
翻遍 Taro 相关的文档,都没有提到这个方法,个人认为可以取代现有的路由库方案,但暂时没有精力整理成 RFC。如果这里不适合发这个,十分抱歉
Sorry, something went wrong.
No branches or pull requests
参考: https://router.vuejs.org/zh/guide/advanced/navigation-guards.html#全局前置守卫
一个自用的方法,能够使小程序代码接近H5原本的vue生态,仅供讨论:
The text was updated successfully, but these errors were encountered: