| 
									
										
										
										
											2022-10-20 18:04:19 +08:00
										 |  |  | <!--
 | 
					
						
							|  |  |  |  * @Author: Kane | 
					
						
							|  |  |  |  * @Date: 2022-10-20 15:07:59 | 
					
						
							|  |  |  |  * @LastEditors: Kane | 
					
						
							| 
									
										
										
										
											2022-10-21 01:19:47 +08:00
										 |  |  |  * @LastEditTime: 2022-10-21 00:07:49 | 
					
						
							| 
									
										
										
										
											2022-10-20 18:04:19 +08:00
										 |  |  |  * @FilePath: \car_dealer\vue\vue_01.html | 
					
						
							|  |  |  |  * @Description:  | 
					
						
							|  |  |  |  *  | 
					
						
							|  |  |  |  * Copyright (c) ${2022} by Kane, All Rights Reserved.  | 
					
						
							|  |  |  | --> | 
					
						
							|  |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  | <html lang="en"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <head> | 
					
						
							|  |  |  |     <meta charset="UTF-8" /> | 
					
						
							|  |  |  |     <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | 
					
						
							|  |  |  |     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | 
					
						
							|  |  |  |     <title>vue3入门</title> | 
					
						
							| 
									
										
										
										
											2022-10-21 01:19:47 +08:00
										 |  |  |     <link rel="stylesheet" href="../css/root.css" /> | 
					
						
							| 
									
										
										
										
											2022-10-20 18:04:19 +08:00
										 |  |  |     <link rel="stylesheet" href="../css/normalize.css" /> | 
					
						
							| 
									
										
										
										
											2022-10-21 01:19:47 +08:00
										 |  |  |     <link rel="stylesheet" href="../css/kane.css" /> | 
					
						
							| 
									
										
										
										
											2022-10-20 18:04:19 +08:00
										 |  |  |     <script src="../js/vue/vue.global.js"></script> | 
					
						
							|  |  |  | </head> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <body> | 
					
						
							|  |  |  |     <div id="app"> | 
					
						
							|  |  |  |         <div class="content"> | 
					
						
							|  |  |  |             <h1>{{title}}</h1> | 
					
						
							|  |  |  |             <h1>{{count}}</h1> | 
					
						
							| 
									
										
										
										
											2022-10-21 01:19:47 +08:00
										 |  |  |             <button type="button" v-on:click="addCount()">计数器</button> | 
					
						
							|  |  |  |             <button type="button" v-on:click="switchButton()">{{btn_title}}</button> | 
					
						
							| 
									
										
										
										
											2022-10-20 18:04:19 +08:00
										 |  |  |         </div> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  | </body> | 
					
						
							|  |  |  | <script> | 
					
						
							|  |  |  |     const app = { | 
					
						
							|  |  |  |         data() { | 
					
						
							|  |  |  |             return { | 
					
						
							|  |  |  |                 title: "vue3 入门!", | 
					
						
							|  |  |  |                 count: 0, | 
					
						
							|  |  |  |                 btn_title: "走你", | 
					
						
							|  |  |  |                 btn_switch: true, | 
					
						
							|  |  |  |             }; | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         methods: { | 
					
						
							|  |  |  |             addCount() { | 
					
						
							|  |  |  |                 this.count++; | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |             switchButton() { | 
					
						
							|  |  |  |                 this.btn_switch = !this.btn_switch; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 this.btn_title = this.btn_switch ? "走你!" : "滚"; | 
					
						
							| 
									
										
										
										
											2022-10-21 01:19:47 +08:00
										 |  |  |             }, | 
					
						
							| 
									
										
										
										
											2022-10-20 18:04:19 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const vm = Vue.createApp(app); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     vm.mount("#app"); | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </html> |