学习中遇到的错误总结

1、javaWeb中使用json格式转换list

解决方法:将所需依赖包放在webapp下的WEB-INF文件夹下。导入包,在pom.xml文件中加入

<dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.7.0</version>
        </dependency>

        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.1</version>
        </dependency>

注意版本号
需要导入的包:commons-beanutils-1.7.0.jar、commons-collections-3.1.jar、commons-lang-2.5.jar、commons-logging-1.1.1.jar、ezmorph-1.0.3.jar、json-lib-2.4-jdk15.jar
本人使用包文件地址:Servlet封装JSON格式所需导入的包

2、在Vue中使用filter出现错误:this.list.filter is not a function

解决方法:判断list的类型,只有数组才可以用filter

3、给页面标签增加href属性总是连接相对地址

在地址前拼接"//"

4、js使用indexOf()或includes()在过滤中出现原型没有此方法错误

查看所编写代码的过滤函数中indexOf或includes前的属性是否存在于对象中

5、js中使用innerHTML或innerText报错

这两个类似于C语言自增的用法,不是方法,直接用innerHTML+='this is text'

6、项目在运行一定时间之后会把Tomcat卡死,必须重新启动

连接数据库后一定要释放连接,否则会内存溢出卡死

7、chrome浏览器快速禁用javascript

按F12或右键检查元素 按ctrl+shift+p 输入js便可以找到选项

8、pycharm插件页显示无法连接

修改http代理添加自定义连接https://plugins.jetbrains.com

pta用python刷题出现非零返回

查看程序是否输出过多
比如判断条件重复判断等

Vue-cil创建文件后.vue文件第一行报错

Parsing error: No Babel config file detected for HelloWorld.vue. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.eslint

在package.json的eslintConfig下parserOptions中添加下面语句
"requireConfigFile": false

关闭vue组件命名提示

package.json中

"eslintConfig": {
    "rules": {
      "vue/multi-word-component-names": 0
    }
  },

关闭组件未使用提示

在rules中加入
"vue/no-unused-components": "off"

关闭vue生产环境提示

在main.js中添加Vue.config.productionTip = false;

vue动画没效果,看一下template里是否只有一个块元素

js数组排序

nums.sort((a,b)=>a-b)

vue路由不起作用

查看路由单词是否错误

nodejs操作mysql数据库报错

Client does not support authentication protocol requested by server; consider upgrading MySQL client

1、 进入数据库后,接着输入:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'q791469353'; 即可,再按下回车键
2、 再输入FLUSH PRIVILEGES; 即可,按下回车键。
参考文章

nodejs使用@hapi/joi和@escook/express-joi进行数据校验报错Cannot mix different versions of joi schemas

将 node_modules/escook/express-joi/index.js 第一行引入换成 const Joi = require('@hapi/joi')
参考文章

div不对齐

vertical-align:top;

Vue父组件向子组件传图片地址

子组件使用require并需要拼接为字符串

webpack热模块更新失效

设置runtimeChunk: 'single'

posted @ 2021-11-26 09:27  浮生阁阁主  阅读(48)  评论(0)    收藏  举报