zoukankan      html  css  js  c++  java
  • vue常用知识点

    1. vue中图片路径写法
                 <img :src="avatorSrc" alt="">
                 <img :src="avatorSrc2" alt="">
            data:function(){
                return {
                    avatorSrc:"https://p.ssl.qhimg.com/dmsmty/74_100_100/t01073ee43c0b8459e4.webp",
                    avatorSrc2:require("../../assets/avator.png"),//图片在本地
                }
            }
    

      2.代码中实现路由跳转

    <el-menu-item index="1-1" @click="goRouter('/workbench/Needs')">needs</el-menu-item>
    <el-menu-item index="1-2" @click="goRouter('/workbench/Risk')">risk</el-menu-item>
    
    
    // 路由跳转
    Vue.prototype.goRouter = function(path){
      this.$router.push(path);
    }

     3.路由拦截设置页面title

    // 路由拦截设置页面title
    router.beforeEach((to,from,next)=>{
      if(to.name){ // name 在 路由中配置
        window.document.title = to.name;
      }
      next();
    })
  • 相关阅读:
    洛谷P2050 美食节
    洛谷P2150 寿司晚宴
    区间最深LCA
    三层交换机
    VLAN 及 GVRP 配置
    GVRP
    VLAN IEEE802.1Q
    以太网端口技术
    网关与路由器
    Quidway S系列交换机
  • 原文地址:https://www.cnblogs.com/jlyuan/p/11706088.html
Copyright © 2011-2022 走看看