vue入门

2020-02-21

直接添加<el-upload发现点击不了,后来才知道,要加在<el-form-item></el-form-item>里面

2020-02-22

1、<template></template>必须以<div>为根,不能两个<div>并列作为根【<template><div></div><div></div></template>】。

2020-02-25

vue-router.esm.js?fe87:1981 Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
    at isESModule (vue-router.esm.js?fe87:1981)
    at eval (vue-router.esm.js?fe87:1910)
    at eval (vue-router.esm.js?fe87:1996)
    at <anonymous>

原来写法

{
        path: '/add_operate',
        name: 'add_operate',
        component: resolve => require(['@/views/operate/add'])
    }

正确写法

{
        path: '/add_operate',
        name: 'add_operate',
        component: resolve => require(['@/views/operate/add'], resolve)
    }

 2020-02-25

修改日期控件,发现上面显示的日期并没有改变。

以前的错误写法

   this.ruleForm = {
        remark: this.addEditData.remark
      };
      if(this.addEditData.purcharsDate!=null && this.addEditData.purcharsDate>0){
          this.ruleForm["purcharsDate"] = this.$dateFormat(this.addEditData.purcharsDate, "yyyy/MM/dd")
      }//后插入

现在正确的写法:

 var purcharsDate = '';
      //alert(this.addEditData.purcharsDate);
      if(this.addEditData.purcharsDate!=null && this.addEditData.purcharsDate>0){
          purcharsDate = this.$dateFormat(this.addEditData.purcharsDate, "yyyy/MM/dd")
      }
      this.ruleForm = {
        remark: this.addEditData.remark,
        purcharsDate: purcharsDate
      };//前插入

2022-11-24

vue打包命令:npm run build

const wslToWindowsPath = async path => {
                               ^^^^
SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\10-10\sx-vue\node_modules\@vue\cli-shared-utils\lib\openBrowser.js:9:1
4)

这个报错是nodejs版本太低了,下载一个最新的就好了。

因为我的系统是win7的,支持的最高版本是v13.14.0

链接:https://pan.baidu.com/s/1xM8m8GxpjoSoGUbbMA2OFw
提取码:05u4

nodejs再高版本就要win8.1及以上了:

This application is only supported on Windows 8.1, Windows Server 2012 R2, or higher.

 

posted on 2020-02-22 14:46  angelshelter  阅读(266)  评论(0编辑  收藏  举报

导航