Tag Archives: & View

Unable to load file D:: program files (x86) node-v16.4.0-win-x861 because scripts are not allowed to run on this system.

1. Problem description

Because you cannot run scripts on your computer

2. Solutions

(1) Run command window as Administrator

(2) Input command: set executionpolicy remotesignated  
3. Restart the command window to solve the problem

4. Just create it again

【 https://blog.csdn.net/u013513178/article/details/114823445 】

Register global time filter in main.js in Vue

In main.js, define a global time filter through: Vue. Filter().
the first parameter is the name of the filter, such as: dataform,
the second parameter is the processing function of the time filter: function(), which needs to specify a formal parameter: originval, which is to process the time data
to get the originval time, first update the date and pass the originval to you, that is, to get a date object of the time according to the local time

Get four digit year through getfullyear()

Get the month through getmonth(). The month starts from 1, so make it + 1
if the month is less than two digits, fill in 0 in the front by calling. Padstart (2, ‘0’). The first parameter represents the total length of the number of digits, and the second parameter is a string. If the number of digits is less than two, which string should be filled in

Get the current date through: getdate()

Get the current hour through: gethours()

Get the current minutes through: getminutes()

Get the current seconds by: getseconds()

Let the obtained date, time, minute and second be spliced into a complete date string
return ${y} - ${m} - ${D} - ${HH}: ${mm}: ${SS}

//Format time filter
vue.filter (‘dataform ‘, function (originval) {
const DT = new date (originval)

const y = dt.getFullYear()
const m = (dt.getMonth() + 1 + ‘’).padStart(2, ‘0’)
const d = (dt.getDate() + ‘’).padStart(2, ‘0’)

const hh = (dt.getHours() + ‘’).padStart(2, ‘0’)
const mm = (dt.getMinutes() + ‘’).padStart(2, ‘0’)
const ss = (dt.getSeconds() + ‘’).padStart(2, ‘0’)

return ${y}-${m}-${d} ${hh}:${mm}:${ss}

Vue More than 1 blank line not allowed

When you create a Vue project, you may encounter this prompt, which literally means that the code is not allowed to have more than one blank line. However, when you write a lot of code and ask for the running result, it is impossible to remove the blank line all the time. The reason is that

There are two solutions to the problem caused by eslint check syntax.
1. Format code: Shift + Alt + F, which can remove redundant blank lines. However, other problems will arise. You will find that after formatting, your string ‘hello word’ will change from single quotation marks to double quotation marks, and you will be warned
2  

 

Warning means that the string must use single quotation marks
we can set it like this and find webpack.base.conf.js in build

Then comment out this line of code, and do not use the eslint verification rule
instead  

2. If you don’t format the code, you can use the second way

Find the file. Eslintrc. JS

Comment out standard and run it again

Solve the problem that the version of less is too high

Implementation  npm install --save less less-loader

After installing less, error will be reported when using less in style

This situation is caused by the over high version of less loader. You can check the current version of less in package.json
to find out  

Therefore, in view of this situation, we can first uninstall the existing less loader, and then install the lower version of less loader
NPM install
NPM install [email protected] –save
 
Run it again

Vue picture path, webpack error resolution after packaging

Recently, there is a problem in the project: when the SRC attribute of img tag is used as a relative path in HTML, and then the project is packaged and deployed online with webpack, the image path will report an error. Because it was built by ourselves, so I stepped on a lot of pits. Baidu has common problems. The problem of wrong image path was solved after a long time.

1. Find config – & gt; In index.js, modify as follows

2. Find build – & gt; Utils.js, add a sentence in it: ‘… /… /’,

3. Img tag introduces the image

<img src="static/images/list_icon.png" alt="">

The Vue project cannot use a component name that contains the word switch

Application scenario: you need to create a new version switching page in the Vue project, which is translated as versionswitch according to the Chinese name, so you build a versionswitch.vue. You find that errors have been reported all the time, and if you change the name to vesionchange.vue, no errors have been reported. After a search, it is found that components cannot be named with switch, nor can they be named with switchye .

Syntax error in Vue ie10 browser

“29616;” 38169;”35823;”

SyntaxError -2146827286

 

@babel/polyfill

e.g. install –save @babel/polyfill

Main.js

import’@babel/polyfill’

 

“21442;” 32771;”38142;” 255091;

https://www.cnblogs.com/yalong/p/9988615.html

 

It is invalid to submit the content directly after pasting it on the mobile terminal of Vue HTML5 editor

Modify the source code vue-html5-editor.js
Directory:

open this file, search for contenteditable, add id = “container”

and then search for Keyup
comment code

 // content.addEventListener('keyup', function () {
 //     this$1.$emit('change', content.innerHTML);
 //     this$1.saveCurrentRange();
 // }, false);

Add code

const handleListenChange = (mutationsList, observer) => {
 this$1.$emit('change', content.innerHTML);
 this$1.saveCurrentRange();
}
const mutationObserver = new MutationObserver(handleListenChange)
const element = document.querySelector('#container')
const options = {
 attributes: true,
 childList: true,
 subtree: true,
 characterData: true
}

It’s like this on the whole

I’ve looked at others and modified it myself. This question is more detailed than that of the blogger. Link to attach. If you have any other questions, take a look
CSDN of Dashen