vue文档分析和总结.docxVIP

  • 6
  • 0
  • 约8.34万字
  • 约 93页
  • 2024-07-26 发布于上海
  • 举报

Vue第一天

Vue.js的组件有三个步骤:创建组件构造器(Vue.extend()方法),注册组件(Vponent())和实例化组件。

!DOCTYPEhtml

html

body

head

title演示Vue/title

/head

divid=container

component1/component1

/div

/body

scriptsrc=./vue.js/script

scripttype=text/javascript

//1.创建一个组件构造器

varcomponent1=Vue.extend({template:divhelloworld/div

});

//2.注册组件,并指定组件的标签为component1Vponent(component1,component1);

//3.实例化组件newVue({

el:#container

});

/script

/html

浏览器编译后html结构会变为

divid=container

divid=container

divhelloworld/div

divhelloworld/div

/div

/div

页面运行显示为

页面运行显示为

helloworld

第1页

PAGE3

PAGE3

第 页

2.

2.

2-1Vue.exte

文档评论(0)

1亿VIP精品文档

相关文档