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
1. Download the corresponding installation file f...
question: <input type="hidden" name=...
What are :is and :where? :is() and :where() are p...
Demand background: Insert GIF dynamic images into...
This article shares the specific code of MySQL 8....
Table of contents Preface Environment Preparation...
Table of contents 1. Resource download 2. Unzip t...
WeChat applet uniapp realizes the left swipe to d...
I have learned some basic selectors of CSS before...
Preface The writing of front-end code can never e...
The effect to be achieved is: fixed zoom in twice...
Analyze the production steps: 1. Prepare resource...
Table of contents 01-Event Bubbling 1.1- Introduc...
When we develop a single-page application, someti...
Here is an introduction to changing the password ...