Blogger Information
Blog 43
fans 4
comment 0
visits 19294
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
VUE安装使用/基础语法
汇享科技
Original
299 people have browsed it

vue安装

  • 在VUE官网提供了两种主流安装方式一种是通过CDN在线使用第二种是npm下载到本地项目中

    1. CDN方式:<script src="https://unpkg.com/vue@next"></script>

    2. npm方式:$ npm install vue@next

  • 安装完成后就可以进行使用了

VUE的基础语法

  • VUE基础语法:1.VUE配置项 2. 创建VUE实例 3.实例与挂载点进行绑定
  1. // 1.创建VUE配置项
  2. let con = {
  3. //将VUE的变量全部写到data()中
  4. data() {
  5. return {
  6. //把数据返回
  7. username:"小汇享",
  8. };
  9. },
  10. };
  11. //2.创建VUE实例
  12. const app = Vue.createApp(con);
  13. //3.将实例挂载
  14. app.mount(".app");

l6ee2nkq.png

  • VUE基础指令:
    1. 模板指令:v-text,v-html
      l6eepnb9.png
    2. 样式绑定:v-bind
      l6ef7kcy.png
      3.数据双向绑定:v-on,v-model
      l6ej4jg4.png
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