Vue.js之父子组件
2024-10-20 16:02:52
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href="demo.css" /> </head> <body> <!--this is my View--> <div id="app"> <parent-component></parent-conponent> </div> <div id="app2"> <my-component></my-conponent> </div> <my-component></my-conponent> </body> <script src="vue.min.js"></script> <script> var Child = Vue.extend({ template: '<p> This is child component</p>' }) var myComponent = Vue.extend({ template: '<div> This is my first component.</div>' }); Vue.component('parent-component', { template: '<div><p> This is Parent component</p><child-component></child-component></div>', components: { 'child-component': Child } }); new Vue({ el: '#app' }) new Vue({ el: '#app2', components: { 'my-component': myComponent } }) </script> </html>
最新文章
- 在SQL语句中加入时间比较作为查询条件
- new一張form時用using{}的好處。
- Xcode 8 在XIB中布局View尺寸1000*1000
- ch6 影响 MySQLServer 性能的相关因素
- CCF真题之门禁系统
- centos 001
- 向Array中添加堆排序
- IOS 8 关于 Touch ID
- I.MX6 lcd lvds hdmi bootargs
- 设计模式之十三:适配器模式(Adapter)
- css盒子模型,定位,浮动
- CSS3 转换2D transform
- vue学习:props,scope,slot,ref,is,slot,sync等知识点
- 【mark】OS是否使用svc方式分开系统空间和用户空间的优劣
- Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed.
- FastAdmin 在 Nginx 中的配置
- windows7下搭建robot framework环境指导
- php用smarty来做简易留言系统,明细步骤简单操作
- json_encode无返回结果
- C语言编程积累2
热门文章
- Android 人脸识别
- 从键盘输入数,输出它们的平方值&;判断是不是2的阶次方数
- 剑指Offer - 九度1355 - 扑克牌顺子
- 【非原创】tomcat 安装时出现 Failed to install Tomcat7 service
- serial console
- ERC720和erc721的区别
- [中山市选2011][bzoj2440] 完全平方数 [二分+莫比乌斯容斥]
- Linux下从零开始部署和使用Jaeger
- [poj] 3057 Evacuation
- POJ 1375 Intervals | 解析几何