关于vue-router:P32-vuerouter-路由组件传参和不同的历史记录

路由组件传参

命名视图

ShopMain.vue


<template>
  <h2>shop 次要内容</h2>
</template>

<script>
export default {
  name: "ShopMain",
  props: ['id'],
  mounted() {
    console.log(this.id)
  }
}
</script>

<style scoped>

</style>

不同的历史记录

hash 模式

二者的区别是有无#

html5模式

#隐没

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理