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
introduce This chapter mainly introduces the proc...
This article shares the specific code of JavaScri...
Preface In MySQL, cross-database queries are main...
Table of contents 1. Project Description 2. Nginx...
1. Install zabbix-agent on web01 Deploy zabbix wa...
Table of contents 1. Three modes of binlog 1.Stat...
mysqlslap Common parameter description –auto-gene...
This article shares the MySQL installation and co...
Table of contents 1. Check the MySQL status in th...
The vue part is as follows: <template> <...
1. MySQL 1.1 MySQL installation mysql-5.5.27-winx...
Table of contents Usage scenarios How to achieve ...
Result:Implementation code: html <!-- Please h...
Table of contents Preface background Big guess Fi...
Table of contents Character Set Comparison Rules ...