zoukankan      html  css  js  c++  java
  • vue-router基本使用

    路由中有三个概念 route routes router

    route 它是一条路由,是单数,home按钮=》home内容,这是一条路由,about按钮=》about内容,这是另一条路由。

    routes 是一组路由,把上面的(route)每一条路由组合起来,形成一个数组。

    router 是一个机制,相当于一个管理者,永凯管理路由。因为routes是定义一组路由,是静止的,当真正来请求时router就起作用了,它在routes中查找,去找到对应的内容。

    客户端的路由,实际上就是dom元素的显示和隐藏。当页面上显示home内容的时候,about中的内容全部隐藏,反之也是一样的,客户端路由有两种实现方式:基于hash和基于html5 history api

    vue-router中的路由也是基于上面的内容来实现的

  • 相关阅读:
    Add Two Numbers
    Reverse Linked List II
    Reverse Linked List
    Remove Duplicates from Sorted List
    Remove Duplicates from Sorted List II
    Partition List
    Intersection of Two Linked Lists
    4Sum
    3Sum
    2Sum
  • 原文地址:https://www.cnblogs.com/xiaofenguo/p/10287706.html
Copyright © 2011-2022 走看看