NUXT3-VUE中的用户oute和userOuter有什么区别
我想了解,
const Route = useRoute()
有什么
const Router = useRouter()
nuxt3/vue中
区别。另外,我无法正确使用路由器。
提交时,我想使用使用查询字符串的另一页。
<template>
<button @click="SearchTaxi"></button>
</template>
<script setup>
import { ref } from 'vue'
const router = useRouter()
const pickuppoint = ref('')
const dropoffpoint = ref('')
const SearchTaxi = () => {
router.push({
path: `/airport-transfers/results?pickuppoint=${pickuppoint.value}&dropoffpoint=${dropoffpoint.value}`})
}
</script>
我希望途径会改变,
"url/airport-transfers/results?pickuppoint=XXXX&dropoffpoint=XXXX"
但我会得到
"url/airport-transfers/results"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两件事:
按下
或替换
),回滚到n-1
,解决等...您可以检查API: https://router.vuejs.org/api/api/
并查看其中每个方法都有哪些方法/字段。
如果要推出一些查询参数和新路径,则可以使用以下内容
,如下所述: https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-a-different-location
There are 2 things:
push
orreplace
), rollback to then-1
, resolve etc...You can check the API: https://router.vuejs.org/api/
And see which methods/fields are available on each one of them.
If you want to push some query params and a new path, you could use the following
As explained here: https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location