Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use console.log to print in vue

Shulou Source: shulou.com Published: 2022-05-31 18:22:51 09月19日 Update

This article mainly explains "how to use console.log printing in vue". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use console.log printing in vue.

Vue prints using console.log

1. Use window.console.log ()

two。 Change the configuration:

Add "no-console": "off" to the rules object in the eslintConfig option in the package.json file

Comment all console.log in vue

In the process of front-end development, we usually print a lot of logs, but when we publish them online, we don't want customers to see other information, but one comment after another is too troublesome to update later.

Here is a very simple way to solve the problem with one line of code.

Add the following line of code to main.js

Console.log = function () {}

If you want to modify the code for print log view, comment this line of code on OK~.

At this point, I believe you have a deeper understanding of "how to use console.log printing in vue". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Code comments one line content method log time learning practical deeper information interest front end practical practical customer object simple operation file more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Huawei MySQL Redmi Shulou Information