api.getxx({},(res)=>{
this.data1 = res
this.data2 = res
})
this.data1.splice(1,1) The value of data2 will also change.
Solution: cloning
api.getxx({},(res)=>{
this.data1 = res
this.data2 = res.slice(0)
})
Recently, when using element-ui to build a project, I found it unfriendly for beginners to configure various files to run element-ui only with webpack.
Think of using vue-cli to build the entire Vue project.
1.Install node.js
2.Install webpack
Global install webpack command
npm install webpack -g
3.Installation of Taobao mirror [fast speed children’s shoes can be omitted].
1 npm install -g cnpm --registry=https://registry.npm.taobao.org
4.vueScaffold global installation — used to generate Vue templates
npm install -g vue-cli
Understanding it as a way to get you started quic...
“Webpack-dev-server is not an internal or external command, nor is it a runnable program or batch file” that recently appeared when using vue-cli to build directories
After looking up a lot of data and solutions on the Internet, the path that should be an environment variable does not read NPM in combination with its own situation.
False report
The solution is to find the NPM directory and add it to the environment variable path.
OK!Perfect solution!!!
SSR:Server Side Rendering(Server render)
The purpose is to solve the single page application of the SEO problem, for the general site has little impact, but for the forum class, content class site is fatal, search engines can not grab page-related content, that is, users can not find the relevant information of this site.
VUESSR based on NUXT
1 .Create file address
First create a folder, I use the HBuilder editor, then drag the folder into the editor and open CMD in the folder you created
2.Input installation command:
1). npm install –global vue-cli
2). vue init webpack my-project
When you install second, the page will appear.
During installation, you will be asked whether you need to configure routing, testing and so on.
Project name Project name (enter)
Porject description Project description (enter)
Author (enter)
Install vue-router Do you follo...
HTMLDefinition
Hypertext Markup Language (HTML) is also a markup language to create web pages.
Essentially browser-recognizable rules, we write web pages according to rules, browsers render our web pages according to rules, for different browsers, the same tag may have different interpretations (compatibility issues)
Web file extension:.Html/.htm (the latter is not commonly used)
Hypertext: refers to the page can contain pictures, links, and even music, programs and other non text.
Markup Language: the language of tags (labels).
Web page ==HTML document, resolved by browser, used to display...
Received a demand these days, there is a need to do a property component, looking for a third party, but can not fully meet my needs, there is time, I do a small wheel it.
Let’s look at the renderings first.The font icon used before the red dot is a right sign. Here, for convenience, the circle is used instead of the selected state, so it is not very good-looking. It needs to be modified by itself.)
I directly use vue-cli to build the project, the code directory is as follows:
The way of use is as follows:
treeDataThe format is as follows:
treeData: [
{open: false, name: '...
DTD(Document Type Definition)Document type definition:
DTDUsed to define the structure of an XML document, as a content model for a canonical XML document, DTD is formalized in various domainsA unified specification document.
Use DTD in XML documents:
Internal DOCTYPE statement:
Wrap the DTD:<!! DOCTYPE root element in the XML document [element declaration]>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE student [
<!ELEMENT student (name,hometown,age)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT hometown (#PCDATA)>
<!ELEMENT age (#PCDATA)>
]>...