Tag Archives: vue

Question: Vue or HTML prompts “cannot red property getcontext of null” when creating canvas?

Problems encountered:
When using the SVGA icon in a Vue project, I encountered Canvas Canvas <; cannot read property "getContext" of null.> Such an error, it is finally known that the page load order caused the problem. Solution: In a normal HTML page, a js method can be placed either in the head or before the end of the body tag, but there are some differences. When in the head tag, it is usually just loaded and not automatically executed immediately. It will only be executed after being triggered. Therefore, when the script tag is in this location, variables in JavaScript are not initialized, so the above error may occur; Before the end of the body tag, the JavaScript is loaded and executed immediately. This time, however, the problem was that the method was called before the page had finished loading. Solution: Based on the above analysis, there are two ways to solve this problem in normal HTML: Put the script tag directly after the end of the body tag. When the script tag is in the head tag, you can automatically fire this event by introducing something like window.onload. This time, the answer is to let the page load completely before calling the method.

Error in Babel configuration of webpack

In the configuration of Babel times wrong below

as we can see from the error prompt time configuration Babel when make a mistake, then we need to look to the specific configuration of Babel, this is my configuration

from the configuration, see can see problems in persets words are spelt wrong, this kind of error is quite common, the correct method is presets

Vue running error: error failed to compile with 1 errors, browser error: cannot get/

Error Failed to compile with 1 errors: Cannot GET /
Share the solution to the problem I encountered for your reference!
Today, while running the Vue project, the following error occurred on the command line:

 
Browser access returned the following error: no root route was found

 
Js, and the actual name of the project has changed. In the configuration file, the name is main.html, and in the root directory of the project, it is index.html

Therefore, change main.html to index.html in the configuration file and the project will start successfully.
 

These dependencies were not found

ERROR Failed to compile with 2 errors
These dependencies were not found:
@/views/enterprise_users/enterprise_verify.vue in ./src/router/index.js
@/views/enterprise_users/index.vue in ./ SRC /router/index.js
Vue :
br>
Vue :
Vue :
Vue :
>

>

Error creating project by Vue yorkie: command failed

After long unused VUE, I needed to create a VUE project: VUE Create MyAPP, then prompted whether to change the image to taobao image, and finally reported yorkie: Command failed.
After many attempts, it failed, and finally
cancel taobao mirror
NPM config delete registry
Vue Create + MyProject succeeded!
There are so many mistakes, different reasons, different solutions.

Vue — run ‘NPM audit fix’ to fix them, or ‘NPM audit’ for details appears when initializing the installation

Initialize NPM install, run ‘NPM Audit fix’ to fix them, or ‘NPM audit’ for details, then execute the following command:

npm audit fix
npm audit fix --force
npm audit

Specific problems and repair:

PS F:\Program Files\vue\**—vue> npm install
npm WARN deprecated [email protected]: Deprecated in favor of vinyl-ftp.
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.      
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.     

> [email protected] install F:\Program Files\vue\**—vue\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\ww\AppData\Roaming\npm-cache\node-sass\4.13.1\win32-x64-72_binding.node

> [email protected] install F:\Program Files\vue\**—vue\node_modules\husky
> node ./bin/install.js

husky
setting up Git hooks
done


> [email protected] postinstall F:\Program Files\vue\**—vue\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall F:\Program Files\vue\**—vue\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> [email protected] postinstall F:\Program Files\vue\**—vue\node_modules\tui-chart\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall F:\Program Files\vue\**—vue\node_modules\node-sass
> node scripts/build.js

Binary found at F:\Program Files\vue\**—vue\node_modules\node-sass\vendor\win32-x64-72\binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @fullcalendar/[email protected] requires a peer of vue@^2.6.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of html-webpack-plugin@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\abbrev):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\abbrev' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.abbrev.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\ansi-regex):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\ansi-regex' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.ansi-regex.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\aproba):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\aproba' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.aproba.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\balanced-match):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\balanced-match' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.balanced-match.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\chownr):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\chownr' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.chownr.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\code-point-at):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\code-point-at' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.code-point-at.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\concat-map):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\concat-map' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.concat-map.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\console-control-strings):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\console-control-strings' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.console-control-strings.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\core-util-is):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\core-util-is' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.core-util-is.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\deep-extend):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\deep-extend' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.deep-extend.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\delegates):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\delegates' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.delegates.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\detect-libc):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\detect-libc' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.detect-libc.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\fs.realpath):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\fs.realpath' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.fs.realpath.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\has-unicode):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\has-unicode' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.has-unicode.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\inherits):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\inherits' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.inherits.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\ini):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\ini' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.ini.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\isarray):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\isarray' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.isarray.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\minimist' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\ms):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\ms' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.ms.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\npm-normalize-package-bin):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\npm-normalize-package-bin' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.npm-normalize-package-bin.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\number-is-nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\number-is-nan' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.number-is-nan.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\object-assign):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\object-assign' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.object-assign.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\os-homedir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\os-homedir' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.os-homedir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\os-tmpdir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\os-tmpdir' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.os-tmpdir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\path-is-absolute):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\path-is-absolute' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.path-is-absolute.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\process-nextick-args):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\process-nextick-args' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.process-nextick-args.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\safe-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\safe-buffer' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.safe-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\safer-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\safer-buffer' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.safer-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\sax):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\sax' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.sax.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\semver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\semver' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.semver.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\set-blocking):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\set-blocking' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.set-blocking.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\signal-exit):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\signal-exit' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.signal-exit.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\strip-json-comments):
e\**—vue\node_modules\fsevents\node_modules\.strip-json-comments.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\util-deprecate):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\util-deprecate' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.util-deprecate.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\wrappy):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\wrappy' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.wrappy.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents\node_modules\yallist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\yallist' -> 'F:\Program Files\vue\**—vue\node_modules\fsevents\node_modules\.yallist.DELETE'

added 1812 packages from 1927 contributors and audited 24450 packages in 95.77s

26 packages are looking for funding
  run `npm fund` for details

found 11 vulnerabilities (2 low, 7 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN @fullcalendar/[email protected] requires a peer of vue@^2.6.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of html-webpack-plugin@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ [email protected]
+ [email protected]
+ [email protected]
added 17 packages from 47 contributors, removed 6 packages and updated 17 packages in 17.969s

25 packages are looking for funding
  run `npm fund` for details

fixed 7 of 11 vulnerabilities in 24450 scanned packages
  1 vulnerability required manual review and could not be updated
  3 package updates for 3 vulnerabilities involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)
PS F:\Program Files\vue\**—vue> npm atdit fix --force
npm WARN using --force I sure hope you know what you are doing.

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    C:\Users\ww\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

[email protected] C:\Users\ww\AppData\Roaming\npm\node_modules\npm

Did you mean one of these?
    audit
    edit

PS F:\Program Files\vue\**—vue> npm audit

                       === npm audit security report ===                        

# Run  npm install --save-dev [email protected]  to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change

  Moderate        Cross-Site Scripting                                          

  Package         webpack-bundle-analyzer                                       

  Dependency of   webpack-bundle-analyzer [dev]                                 

  Path            webpack-bundle-analyzer                                       

  More info       https://npmjs.com/advisories/826                              



# Run  npm install --save-dev [email protected]  to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change

  Moderate        Cross-Site Scripting                                          

  Package         serialize-javascript                                          

  Dependency of   compression-webpack-plugin [dev]                              

  Path            compression-webpack-plugin > serialize-javascript             

  More info       https://npmjs.com/advisories/1426                             



# Run  npm install --save-dev [email protected]  to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change

  Moderate        Cross-Site Scripting                                          

  Package         serialize-javascript                                          

  Dependency of   copy-webpack-plugin [dev]                                     

  Path            copy-webpack-plugin > serialize-javascript                    

  More info       https://npmjs.com/advisories/1426                             




                                 Manual Review                                  
             Some vulnerabilities require your attention to resolve             
                                                                                
          Visit https://go.npm.me/audit-guide for additional guidance           


  Moderate        Cross-Site Scripting                                          

  Package         serialize-javascript                                          

  Patched in      >=2.1.1                                                       

  Dependency of   uglifyjs-webpack-plugin [dev]                                 

  Path            uglifyjs-webpack-plugin > serialize-javascript                

  More info       https://npmjs.com/advisories/1426                             

found 4 moderate severity vulnerabilities in 24443 scanned packages
  3 vulnerabilities require semver-major dependency updates.
  1 vulnerability requires manual review. See the full report for details.
PS F:\Program Files\vue\**—vue>

Solve the problem of showing unregistered (unknown custom element) when importing components into Ant Design Pro

why
Ant – Design – Pro home page
When using the Ant-Design-Pro management framework directly, the project introduces some commonly used components on demand by default, so it will be wrong to use some rarely used components directly.
default on on demand components

error when introducing Calendar Calendar

The solution
Introduce the component you want into the lazy_use.js file. The component name is basically the English letter before the component library.

lazy_use.js file path

The introduction of
To pilot in this component, then register in the Vue(CTRL + data left to see if you can jump over)

NPM run build failed to package err! Missing script: build

A vUE project packaging error occurred

PS D:\****\*****> npm run build
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\***\AppData\Roaming\npm-cache\_logs\2020-11-25T02_01_03_914Z-debug.log

“Build :prod” : “Ue -cli- Service build” under the scripts in package. Json

"scripts": {
    "dev": "vue-cli-service serve",
    "build:prod": "vue-cli-service build",
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "lint": "eslint --ext .js,.vue src",
    "test:unit": "jest --clearCache && vue-cli-service test:unit",
    "test:ci": "npm run lint && npm run test:unit",
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
    "new": "plop"
  },

SO you can’t use NPM run build to package
instead

 npm run build:prod --report

Keep alive in Vue

keep-alive
Keep-alive is an abstract component built into Vue that allows contained components to remain in state, avoiding repeated component creation and rendering
Keep-alive is generally used in combination with routing and dynamic components to cache components.

<keep-alive>
    <component :is='current'></component>
</keep-alive>

Keep-alive provides include and exclude attributes, both of which support strings or regular expressions. Include means that only components with matching names will be cached. Exclude means that any components with matching names will not be cached.

<keep-alive :include="includeList" :exclude="excludeList">
    <router-view></router-view>
</keep-alive>

Keep-alive caches include matching components and does not cache exclude matching components.