zoukankan      html  css  js  c++  java
  • 《VUE》学习日志

    1.vue+element 键盘回车事件导致页面刷新的问题

    ps:今天发现输入框输入内容后回车就会刷新页面。即:当一个 form 元素中只有一个输入框时,在该输入框中按下回车应提交该表单。如果希望阻止这一默认行为,可以在 标签上添加 @submit.native.prevent。

    <el-form @submit.native.prevent>
    </el-form>

     2.使用element-ui的菜单项点击两下(多次)出现 NavigationDuplicated {_name: "NavigationDuplicated", 报错

    错误:NavigationDuplicated {_name: “NavigationDuplicated”, name: “NavigationDuplicated”, message: “Navigating to current location (”/home/huge") is not allowed", stack: “Error↵ at new NavigationDuplicated (webpack-int…e_modules/element-ui/lib/mixins/emitter.js:29:22)”}

    解决方案:将此段代码放在路由文件即可解决问题

    const originalPush = Router.prototype.push
    Router.prototype.push = function push(location) {
        return originalPush.call(this, location).catch(err => err)
    }
  • 相关阅读:
    Nginx工作原理
    Redis核心原理
    Nginx介绍
    资源平衡与资源平滑
    HDFS(Hadoop Distributed File System)的组件架构概述
    HBase的应用场景及特点
    HBase详解
    Nginx被动健康检查和主动健康检查
    lsof 详解
    Dockerfile文件详解
  • 原文地址:https://www.cnblogs.com/chensv/p/11607510.html
Copyright © 2011-2022 走看看