
报错
Cao_Mary
这个作者很懒,什么都没留下…
-
原创 NodeJS 编写工具包的版本号和帮助文档 [报错:error: unknown option ‘--version]
一般全局的工具包有两个参数必须要处理:–version和–help,分别会输出包的版本号,和帮助文档。编写步骤:1、获取传递参数:NodeJS 通过process.argv获取参数2、根据不同的参数,返回不同内容返回不同内容,除了使用if语句判断自定义指令传递的参数外。还可以使用commander工具,快速编写工具包的版本号和帮助文档。1.安装commander包:npm i commander2.导入commander:const program = require(‘commande2020-11-11 20:59:17110
0
-
原创 报错:Error: Cannot find module
编写自定义执行指令时,写js文件第一行写执行环境#! /usr/bin/env node // 执行环境报错如下:internal/modules/cjs/loader.js:797throw err;^Error: Cannot find module ‘C:*index鏂囦欢鍦╪ode鐜涓墽琛?’?[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)?[39m?[92020-11-11 18:37:36196
0
-
原创 Duplicate keys detected: ‘0‘. This may cause an update error.
报错:Duplicate keys detected: ‘0’. This may cause an update error.原因:同一个模板里,有两个v-for,:key都用的是遍历得到的index<template><div v-for="(value, index) in arr" :key="index"></div><div v-for="(value, index) in arr2" :key="index"></div>2020-09-04 12:31:2639
0
-
原创 vue 使用iscroll5做滚动效果,造成@click点击事件失效
vue组件的click失效,查明原因是被iscroll禁用了。添加preventDefault即可。如下: this.iscroll = new IScroll(this.$refs.wrapper, { preventDefault: false })2020-08-17 20:55:07116
0
-
原创 Invalid prop: type check failed for prop “index“.
Vue使用ElementUI的NavMenu时,有个index属性。此属性需要传递string类型。2020-08-14 13:53:4724
0
-
原创 vue使用本地json文件存放位置
存放在项目的public文件目录下即可2020-08-14 12:30:1775
0
-
原创 Could not install from “element-ui\lib\nav-menu“ as it does not contain a package.json file.
使用Element-UI编写导航栏,需要使用NavMenu。为避免项目过大,[ 按需引用 ] NavMenu后报错:Could not install from “element-ui\lib\nav-menu” as it does not contain a package.json file.。// 按需引用import { NavMenu } from 'element-ui'解决办法:使用NavMenu 按需引用需修改如下:import { Menu, Submenu, MenuIte2020-08-13 21:39:31427
0
-
原创 【Vue报错】did you register the component correctly
问题描述:Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the “name” option.报错原因1::是因为暴露组件的时候加了组件扩展名,导致未识别。//错误写法:export default { name: 'xxx.vue'}//正确写法export default { name: 'xxx'2020-06-22 11:23:54908
0