Blogger Information
Blog 35
fans 0
comment 0
visits 16739
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
VUE基础术语
手机用户311660634
Original
482 people have browsed it
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  9. <style>
  10. .active {
  11. color: red;
  12. }
  13. .bgc {
  14. background-color: lightblue;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <!-- 挂载点 -->
  20. <div id="app">
  21. <!-- 跟组件 -->
  22. <p >用户名:{{neirong}}</p>
  23. <p v-html="ys"></p>
  24. <p v-bind:style="{color:myColor,backgroundColor:bgc}">Hello world</p>
  25. <p :class="[jh,bj]">好好学习</p>
  26. </div>
  27. <script>
  28. // 应用实例
  29. const app = Vue.createApp({
  30. data: function(){
  31. return{
  32. // 将数据声明在返回对象中
  33. neirong:'少壮不努力',
  34. ys:'<em style="color:red;">老大徒伤悲</em>',
  35. myColor: 'red',
  36. bgc: 'yellow',
  37. jh: 'active',
  38. bj: 'bgc',
  39. }
  40. }
  41. })
  42. // 应用实例和挂载点进行绑定
  43. const nr = app.mount('#app')
  44. // 响应式
  45. nr.neirong = '老大徒伤悲'
  46. </script>
  47. </body>
  48. </html>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post