vuejs scope
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>vue</title> <!--
<script src="vue.js"></script>
--> <script src="https://unpkg.com/vue/dist/vue.js"></script> </head>
<body> <div id="counter-event-example">
<parent></parent>
</div> <script> Vue.component('child', {
// 有效,因为是在正确的作用域内
template: '<div class="child"> <slot text="hello from child"></slot></div>',
data: function () {
return {
someChildProperty: true
}
}
}) Vue.component('parent', {
// 有效,因为是在正确的作用域内
template:'<div class="parent"> <child> <template scope="props"> <span>hello from parent</span> <br> <span>{{ props.text }}</span> </template> </child></div>',
data: function () {
return {
someChildProperty: true
}
}
}) new Vue({
el: '#counter-event-example'
}) </script> </body>
</html>
vuejs scope的更多相关文章
- VueJS ElementUI el-table 的 formatter 和 scope template 不能同时存在
暂时可以通过 在 scope template 中自己处理格式化解决 相关issue: 2548
- 【vuejs深入二】vue源码解析之一,基础源码结构和htmlParse解析器
写在前面 一个好的架构需要经过血与火的历练,一个好的工程师需要经过无数项目的摧残. vuejs是一个优秀的前端mvvm框架,它的易用性和渐进式的理念可以使每一个前端开发人员感到舒服,感到easy.它内 ...
- Vuejs的一些总结
http://blog.csdn.net/xllily_11/article/details/52312044 原文链接:http://mrzhang123.github.io/2016/07/14/ ...
- vuejs点滴
博客0.没事的时候可以看的一些博客:https://segmentfault.com/a/1190000005832164 http://www.tuicool.com/articles/vQBbii ...
- VueJs学习笔记
在cmd下,进入目录之后 cd 到项目目录下 1 安装node cnpm install 2 启动或者调试 cnpm start (或是npm run dev) 3 上线: npm run b ...
- vuejs心法和技法
原文地址:http://www.cnblogs.com/kidsitcn/p/5409994.html 所有的vuejs组件都是被扩展的vue实例: var MyComponent = Vue.ext ...
- VueJs 学习笔记
VueJs学习笔记 参考资料:https://cn.vuejs.org/ 特效库:TweenJS(补间动画库) VelocityJS(轻量级JS动画库) Animate.css(CSS预设动画库) ...
- vuejs angularjs 框架的一些比较(vue项目重构四)
使用Angularjs和Vue.js对比 首先需要说明的是:现在默认angularjs指angular1.0+版本,angular默认指2.0以上版本.本文的名词也默认指定angular的1.0+版本 ...
- VueJS坎坷之路111---_self.$scopedSlots.default is not a function
VueJs + Element 话不多说,直接贴错: _self.$scopedSlots.default is not a function <el-table stripe border r ...
随机推荐
- LA 6437 Power Plant (prim最小生成树)
还是裸的最小生成树 #include<bits/stdc++.h> using namespace std; int T,N,M,P,K,a,b,c; int dist[1020],m[1 ...
- bzoj1305: [CQOI2009]dance跳舞(二分答案+网络流)
1305: [CQOI2009]dance跳舞 题目:传送门 题解: 一眼网络流基础建模...然后就GG了 二分答案+拆点建边+最大流判断: 把男女生拆为男1,男2,女1,女2 1.男1和男2还有女1 ...
- sas与mysql连接方法
2012年8月11日 sas 9.1.3 版本 与mysql 连接 测试,可以与数据库连接1 通过odbc 直接连通 pass through connect to odbc create tabl ...
- Linux基础03
** Linux基本操作常用命令(三) ** Linux的软件包 Linux的软件把分为“源码包”和“二进制包” 源码包:免费,开源 二进制包:系统默认包,即RPM包(上一节我们通过rpm卸载过ope ...
- C# Lambda && Linq
Lambda表达式在C#3.0加入,它是一个匿名函数,可用于创建委托或者表达式树类型,运算符为=>,读作"goes to",=>左侧是变量,右侧是表达式,变量类型可以自 ...
- 3DES(或称为Triple DES)是三重数据加密算法(TDEA,Triple Data Encryption Algorithm)
3DES(或称为Triple DES)是三重数据加密算法(TDEA,Triple Data Encryption Algorithm)块密码的通称.它相当于是对每个数据块应用三次DES加密算法.由于计 ...
- 【原创】TimeSten安装与配置
1.安装TimeSten 2.安装时要指定TNS_ADMIN_LOCATION,即tnsnames.ora的路径,因为tt会根据这个连接Oracle.C:\TimesTen\tt1122_32\net ...
- Ubantu 14.04下安装高版本cmake
Ubantu14.04 下自带的cmake版本比较低(默认为2.8),这里我们从源码编译高版本cmake: 先卸载电脑上安装的cmake (如何已安装的话): sudo apt-get autorem ...
- SpringBoot学习笔记(4)----SpringBoot中freemarker、thymeleaf的使用
1. freemarker引擎的使用 如果你使用的是idea或者eclipse中安装了sts插件,那么在新建项目时就可以直接指定试图模板 如图: 勾选freeMarker,此时springboot项目 ...
- H5页面在线制作工具搜集
1.初页 http://chuye.cloud7.com.cn/ 2.易企秀 http://eqxiu.com/#/home 3.最酷 http://www.zuiku.com/ 4.易传单 http ...