Vue学习第一个程序

/

引入Vue框架:

  1. <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

编写页面

  1. <div id="app">
  2. {{msg}}
  3. </div>

编写数据驱动脚本

  1. <script>
  2. var app=new Vue({
  3. el:"#app",
  4. data:{
  5. msg:"Hello World!"
  6. }
  7. })
  8. </script>

显示结果如下:

Hello World!

每天学一点!

Reproduced please indicate the author and the source, and error a link to this page.
text link: //v2ci.com/6.html