您正在查看: Other-经验分享 分类下的文章

Elements in iteration expect to have 'v-bind:key' directives错误的解决办法

在用vscode编写vue代码时,因为安装的有vetur插件,所以当代码中有v-for语法时,会提示,Elements in iteration expect to have 'v-bind:key' directives.这个错误
这是ESLint的功能,对vue进行了eslint检查。那么我们就把eslint对该插件的检查关闭,

更改vetur配置vscode->首选项->设置->搜索(vetur)

"vetur.validation.template": true  //改成  false

保存,我们再看一下vue文件,发现不报错了。

Vue vscode 格式化配置

打开vscode 插件,找到已安装的 Vetur(提前安装),点击设置

会自动打开settings.json文件,编辑内容

"vetur.format.defaultFormatterOptions": {
    "prettyhtml": {
        "printWidth": 300, // No line exceeds 300 characters
        "singleQuote": false // Prefer double quotes over single quotes
    }
}

然后保存,就可以在打开Vue文件的编辑框中快乐的右键格式化文档了。

让 el-dialog 居中,并且内容多的时候内部可以滚动

.el-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0 !important;
    transform: translate(-50%, -50%);
    max-height: calc(100% - 30px);
    max-width: calc(100% - 30px);
    display: flex;
    flex-direction: column;
}

.el-dialog__body {
    overflow: auto;
}

转载自https://www.cnblogs.com/wbyixx/p/11937106.html

解决Unexpected end of JSON input while parsing near 问题

终端执行命令npm cache clean --force
完成后再执行命令npm install

Install MySQL 8 on Windows 10 64bit

下载

下载地址:https://dev.mysql.com/downloads/mysql/8.0.html

1.解压

mysql-8.0.19-winx64.zip

演示文件目录

C:\Program Files\mysql-8.0.19-winx64

2.创建两个文件夹

C:\Program Files\mysql-8.0.19-winx64\data
C:\Program Files\mysql-8.0.19-winx64\logs

3.设置环境变量

4.新建my.ini配置

[mysqld]
#安装目录
basedir = C:\Program Files\mysql-8.0.19-winx64
#数据文件目录
datadir = C:\Program Files\mysql-8.0.19-winx64\data
port = 3306
server_id = 1
general_log = ON
general_log_file = C:\Program Files\mysql-8.0.19-winx64\logs\mysql.log
log_error = C:\Program Files\mysql-8.0.19-winx64\logs\error.log
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
character-set-server = utf8mb4
performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256
#sql_mode=ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES
[mysql]
default-character-set = utf8mb4

[client]
default-character-set = utf8mb4

5.管理员权限开启CMD窗口

5.1 初始化
mysqld --initialize --console #不用特别指定default file默认会使用my.ini

控制台输入如下表示成功

C:\Program Files\mysql-8.0.19-winx64>mysqld --initialize --console
2020-04-21T10:11:25.148253Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2020-04-21T10:11:25.148318Z 0 [System] [MY-013169] [Server] C:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) initializing of server in progress as process 8684
2020-04-21T10:11:47.571686Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Fv?_a7%jn_R(

Warning暂时没做理会,没发现使用异常
记下上面日志最后面的root的初始化密码Fv?_a7%jn_R(,下面要用到

5.2 安装服务
mysqld --install [服务名] #不写服务名默认为mysql
5.3 启动数据库
C:\Program Files\mysql-8.0.19-winx64>net start mysql
MySQL 服务正在启动 ..
MySQL 服务已经启动成功。
5.4 使用临时密码登陆数据库
C:\Program Files\mysql-8.0.19-winx64>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.19

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
5.5 修改root初始化密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '要改的新密码';