1. Vue automatic compilation error (Strings must use singlequote, quotes– double quotes) Extra semicolon, EMI —- Unexpected trailing comma, comma-dangle– comma.)

**##### Solution: Set in the configuration file eslintrc.js

rules:{
‘comma-dangle’: ‘off’, // Whether closing commas are allowed in objects
‘quotes’: ‘off’,// quotes type
‘semi’: ‘off’// statements touch mandatory semicolon endings
}

ESLint has three levels of rules:

“Off” or 0, disables this rule
“Warn” or 1, there will be a warning if there is a problem
“Error” or” 2 “, you get an error if you have a problem

2. An error occurs after the less-Loader module is installed on the vue

Cause: The version of less-Loader installed is too high
Solution:
1.npm uninstall less-loader
2.npm install [email protected]

3. Reference of Ali icon library

Download the iconfont code and place it under project Assets. The code reference is shown below:

4.VUE: error ‘res’ is assigned a value but never used no-unused-vars

Error cause: ESLint validation syntax
Solution: Add a comment after the error statement // eslint-disable-line no-unused-vars

5. Center the CSS horizontally and vertically

Using absolute positioning, position the upper-left corner of an element to the center of the page with Top :50% and left:50%, then adjust the element’s center point to the center of the page with Translate. This method needs to consider browser compatibility issues.

.parent { position: relative; } .child { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); }

Using absolute positioning, set the values of the four directions to 0, and set the margin to auto. Since the width and height are fixed, the corresponding directions are evenly divided, and the horizontal and vertical directions can be centered. This method is applicable to the case where the box has width and height:

`.parent { position: relative; }

.child { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; } `

Using absolute positioning, position the top left corner of the element to the center of the page with top:50% and left:50%, and then adjust the center point of the element to the center of the page with margin negative values. This method is applicable to the case where the width and height of the box are known

`.parent { position: relative; }

.child { position: absolute; top: 50%; left: 50%; margin-top: -50px; Margin-left: -50px; margin-left: -50px; / half of its width */} ‘

Using flex layout, the container is centered vertically and horizontally with align-items: Center and context-Content: Center, and then its children can be centered vertically and horizontally as well. Compatibility should be considered in this method, which is widely used in mobile terminals:

.parent { display: flex; justify-content:center; align-items:center; }

6. Brew installation error after Mac Big Sur upgrade is resolved

Error: Failure while executing; tar --extract --no-same-owner --file /Users/xxxx/Library/Caches/Homebrew/downloads/f839b337f0ac1b367e2bdd72123940432a73834db77556858cefb671c2471aba--brotli-1 . 0.9. Big_sur. Bottle. Tar. Gz - directory/private/TMP/d20210623-7058-5 w61ky exited with 1. Here’s the output:
tar: Error opening archive: Failed to open ‘/Users/xxxx/Library/Caches/Homebrew/downloads/f839b337f0ac1b367e2bdd72123940432a73834db77556858cefb671c2471aba–brotli- 1.0.9. Big_sur. Bottle. Tar. Gz ‘
Replace the homebrew – bottles:
The first step is to distinguish between the terminal tools you use on your MAC,
If it is bash, execute:

Echo ‘export HOMEBREW_BOTTLE_DOMAIN=mirrors.ustc.edu.cn/homebrew-bo… ‘ >> ~/.bash_profile

source ~/.bash_profile

If ZSH is used, run:
echo ‘export HOMEBREW_BOTTLE_DOMAIN=Mirrors.ustc.edu.cn/homebrew-bo…’ >> ~/.zshrc

source ~/.zshrc

Then go to BREW to install, success.

Other mirror replacements:

Replace the brew. Git: git – C “$(the brew – repo)” remote set – url origin mirrors.ustc.edu.cn/brew.git

Replace the homebrew – core. Git: git – C “$(brew – repo homebrew/core)” remote set – url origin mirrors.ustc.edu.cn/homebrew-co…

Replace the homebrew – cask. Git: git – C “$(brew – repo homebrew/cask)” remote set – url origin mirrors.ustc.edu.cn/homebrew-ca…

— — — — — — — —

The original link: blog.csdn.net/ljl6158999/…