Preface: 1. Vue installation
Method 1: CDN introduction<!--Development environment version, including helpful warning commands--> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> <!--Generated version, optimized for size and speed--> <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> Method 2: Direct download and importDevelopment environment: https://vuejs.org/js/vue.js Production environment: https://vuejs.org/js/vue.min.js Method 3: npm installation It is recommended to use # Latest stable version$ npm install vue 2. Basic use To use The sample code is as follows: <div id="app"> {{message}} </div> </body> <script> const app = new Vue({ el: "#app", data: { message: "Beginner Vue" } }) </script> The data in for example: <!--Cannot render here--> <p>{{message}}</p> </body> <script> const app = new Vue({ el: "#app", data: { message: "Beginner Vue" } }) </script> You can also add The sample code is as follows: <div id="app"> <p>{{greet()}}</p> </div> </body> <script> const app = new Vue({ el: "#app", data: { message: "Beginner Vue" }, methods: { greet: function () { return "hello" + this.message } } }) </script> This is the end of this article about Vue installation and usage. For more relevant Vue installation and usage content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Analysis of the principle of centering elements with CSS
>>: Advantages and disadvantages of conditional comments in IE
Table of contents one. environment two. Precautio...
Table of contents 01 Introduction to Atomic DDL 0...
By default, the reading and writing of container ...
Some time ago, the project needed to develop the ...
The full name of Blog should be Web log, which me...
1. Download docker online yum install -y epel-rel...
During the development process, I often encounter...
Table of contents 1. Where to write JavaScript 2....
Table of contents background How to determine whe...
Add inline styles to the required links: Copy code...
This article shares with you how to import Excel ...
Table of contents I've been learning React re...
Experimental environment • A minimally installed ...
When working on a recent project, I found that th...
Original article: Ultimate IE6 Cheatsheet: How To...