zoukankan      html  css  js  c++  java
  • element UI 的学习一,路由跳转

    1、项目开始;
     # 安装vue
        $ cnpm install vue@2.1.6
        # 全局安装 vue-cli
        $ cnpm install --global vue-cli
        # 创建一个基于 webpack 模板的新项目my-project
        $ vue init webpack my-project
        # 进入项目目录
        $ cd my-project
        # 安装依赖,走你
        $ cnpm install
        # 运行项目
        $ cnpm run dev

    2、安装element-ui
      $ cnpm i element-ui@1.0.9
        固定版本号
      建议固定vue和element-ui的版本,避免将来版本升级后产生冲突
    3、  引入element-ui
       
        在app.vue引入element-ui,然后就可以在其他任何页面中使用了
        import Element from 'element-ui'
        import 'element-ui/lib/theme-default/index.css'
        Vue.use(Element)
    4.el-menu 路由的使用;
    5、字体;font-family: "Helvetica Neue",Helvetica,"PingFang SC",
    "Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
    6、<div id="sideBar">
                <!--<ul>
                    <router-link to="/manifests" tag="li">日消费明细</router-link>
                    <router-link to="/daily" tag="li">日消费清单</router-link>
                    <router-link to="/monthly" tag="li">月消费清单</router-link>
                    <router-link to="/yearly" tag="li">年消费清单</router-link>
                </ul>-->
                <el-menu default-active="manifests" theme="dark" v-bind:router="true">
                    <el-menu-item index="manifests">日消费明细</el-menu-item>
                    <el-menu-item index="daily">日消费清单</el-menu-item>
                    <el-menu-item index="monthly">月消费清单</el-menu-item>
                    <el-menu-item index="yearly">年消费清单</el-menu-item>
                </el-menu>
            </div>
    路由部分对应JS代码
    const router = new VueRouter({
        routes: [
            { name: "manifests", path: "/manifests", component: Manifests },
            { name: "daily", path: "/daily", component: Daily },
            { name: "monthly", path: "/monthly", component: Monthly },
            { name: "yearly", path: "/yearly", component: Yearly }
        ]
    });

  • 相关阅读:
    Perl的运算符号字符
    windows xp 使用远程桌面时的关机/重新启动方法
    抵御TCP的洪水
    远程桌面连接中的常见问题 连接上就断开
    批量kill mysql进程
    Linux如何查看硬盘型号和缓存
    Apache Rewrite 规则详解
    nginx 内置变量大全
    大数据量分页存储过程效率测试附代码
    ASP.Net 更新页面输出缓存的几种方法(包括用户控件,iframe,页面缓存等)
  • 原文地址:https://www.cnblogs.com/sxz2008/p/6762375.html
Copyright © 2011-2022 走看看