zoukankan      html  css  js  c++  java
  • vue项目1-pizza点餐系统6-路由精讲之复用router-view

    1、在主组件展示二级路由的组件内容,在App.vue中添加

    <br>
        <div class="container">
          <!-- row 行排列 -->
          <div class="row">
            <!-- 小屏展示12列,中屏展示4列 -->
            <div class="col-sm-12 col-md-4">
              <router-view name="orderingGuide"></router-view>
            </div>
            <div class="col-sm-12 col-md-4">
              <router-view name="delivery"></router-view>
            </div>
            <div class="col-sm-12 col-md-4">
              <router-view name="history"></router-view>
            </div>
          </div>
        </div>
    

    2、在index.js中修改路由配置

    {path: '/', name: 'homeLink', components:{
          default:Home,
          'orderingGuide':OderingGuide,
          'delivery':Delivery,
          'history':History
        }},
    

      

     

  • 相关阅读:
    git升级
    redis集群
    redis安装
    escript
    git搭建仓库与服务器
    svnsync
    post_commit.sh
    nvm安装和使用
    quartz 定时器
    Oracle flashback恢复误删的数据或表
  • 原文地址:https://www.cnblogs.com/JimShi/p/11195035.html
Copyright © 2011-2022 走看看