Home  >  Article  >  Web Front-end  >  What is the difference between vue and javascript

What is the difference between vue and javascript

coldplay.xixi
coldplay.xixiOriginal
2021-01-25 17:40:2627301browse

The difference between vue and javascript: 1. javaScript is a scripting language that runs on the browser side, while Vue.js can be used as a js library and is a progressive JavaScript framework for building user interfaces; 2. js needs to obtain the DOM object, and Vue binds the value to the js object.

The operating environment of this tutorial: Windows 10 Home Chinese version, javascript1.8.5&&Vue2.9.6 version, Acer S40-51 computer. This method is suitable for all brands of computers.

The difference between vue and javascript:

javaScript is a scripting language that runs on the browser side. JavaScript mainly solves the problem of front-end interaction with users. Problems include using interactivity to interact with data. JavaScript is interpreted and executed by the browser.

Vue.js can be used as a js library, or you can use its full set of tools to build system interfaces. These can be flexibly selected according to the needs of the project, so Vue.js It is a progressive JavaScript framework for building user interfaces. Vue's core library only focuses on the view layer. Vue's goal is to implement response data binding through the simplest possible API. At this point, Vue.js is similar to the background template language. It is essentially js code

javaScript gets the tag element:

<script>
var h1 = document.getElementById("title")
var h2 = document.getElementsByTagName("h1");
console.log(h1.innerHTML)
h1.innerHTML=&#39;修改后的标题&#39;
</script>

Vue gets the tag element:

var vm = new Vue({
    el:"#box1",
    data:{
        content:"标题"
    },
    methods:{
        dianji1:function () {
             this.content = "修改后的标题"
        }
    }
})

Summary:

  1. js must first obtain the DOM object, and then modify the value of the DOM object.

  2. Vue first binds the value to the js object, and then modifies the js object. value, the Vue framework will automatically update the DOM value.

Related free learning recommendations: javascript (video)

The above is the detailed content of What is the difference between vue and javascript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn