<!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的更多相关文章

  1. VueJS ElementUI el-table 的 formatter 和 scope template 不能同时存在

    暂时可以通过 在 scope template 中自己处理格式化解决 相关issue: 2548

  2. 【vuejs深入二】vue源码解析之一,基础源码结构和htmlParse解析器

    写在前面 一个好的架构需要经过血与火的历练,一个好的工程师需要经过无数项目的摧残. vuejs是一个优秀的前端mvvm框架,它的易用性和渐进式的理念可以使每一个前端开发人员感到舒服,感到easy.它内 ...

  3. Vuejs的一些总结

    http://blog.csdn.net/xllily_11/article/details/52312044 原文链接:http://mrzhang123.github.io/2016/07/14/ ...

  4. vuejs点滴

    博客0.没事的时候可以看的一些博客:https://segmentfault.com/a/1190000005832164 http://www.tuicool.com/articles/vQBbii ...

  5. VueJs学习笔记

      在cmd下,进入目录之后 cd 到项目目录下 1 安装node cnpm install   2 启动或者调试 cnpm start (或是npm run dev) 3 上线: npm run b ...

  6. vuejs心法和技法

    原文地址:http://www.cnblogs.com/kidsitcn/p/5409994.html 所有的vuejs组件都是被扩展的vue实例: var MyComponent = Vue.ext ...

  7. VueJs 学习笔记

    VueJs学习笔记 参考资料:https://cn.vuejs.org/ 特效库:TweenJS(补间动画库)  VelocityJS(轻量级JS动画库) Animate.css(CSS预设动画库) ...

  8. vuejs angularjs 框架的一些比较(vue项目重构四)

    使用Angularjs和Vue.js对比 首先需要说明的是:现在默认angularjs指angular1.0+版本,angular默认指2.0以上版本.本文的名词也默认指定angular的1.0+版本 ...

  9. VueJS坎坷之路111---_self.$scopedSlots.default is not a function

    VueJs + Element 话不多说,直接贴错: _self.$scopedSlots.default is not a function <el-table stripe border r ...

随机推荐

  1. C#高级编程五十八天----并行集合

    并行集合 对于并行任务,与其相关紧密的就是对一些共享资源,数据结构的并行訪问.常常要做的就是对一些队列进行加锁-解锁,然后运行类似插入,删除等等相互排斥操作. .NET4提供了一些封装好的支持并行操作 ...

  2. bzoj4519: [Cqoi2016]不同的最小割(分治最小割)

    4519: [Cqoi2016]不同的最小割 题目:传送门 题解: 同BZOJ 2229 基本一样的题目啊,就最后用set记录一下就ok 代码: #include<cstdio> #inc ...

  3. JAVA设计模式之【职责链模式】

    职责链模式 专门处理请求链式传递的模式 角色 Handler抽象处理者 ConcreteHandler具体处理者 在职责链模式中,很多对象由每一个对象对其下家的引用而连接成一条链,请求在这条链上传递, ...

  4. javascript系列-class9.DOM(上)

    欢迎加入前端交流群交流知识获取视频资料:749539640 1.文档对象模型DOM(document Object Model)        所谓DOM就是以家族的形式描述HTML       节点 ...

  5. [nginx]第一篇

    世界太大,我无法安心学习,决定看一个简单的. nginx-1.11.9的代码是nginx-0.5.38的两倍,决定看前者的. 阅读工具:UnderStand 3.1. 入口在nginx.c的195行. ...

  6. 3ds Max 2018 在安装后无法启动或出现不稳定

    问题: 安装 3ds Max 2018 后,软件无法正常启动,或在打开后不久出现不稳定和崩溃. 原因: 有多种原因可能会导致这些错误: ▪ 3ds Max.Windows 更新和 ProSound.d ...

  7. 启动tomcat运行maven工程报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:

    控制台报错信息:

  8. Hadoop-2.4.1 ubuntu集群安装配置教程

    一.环境 系统: Ubuntu 14.04 32bit Hadoop版本: Hadoop 2.4.1 (stable) JDK版本: 1.7 集群数量:3台 注意事项:我们从Apache官方网站下载的 ...

  9. C#获取实例运行时间StopWatch类

    在程序运行时有时需要获取某一步骤的操作时间,C#提供的StopWatch类可以很方便的实现这一目的. StopWatch sw=new StopWatch(); sw.Start(); //Do So ...

  10. LightOJ-1236 Pairs Forming LCM 唯一分解定理

    题目链接:https://cn.vjudge.net/problem/LightOJ-1236 题意 给一整数n,求有多少对a和b(a<=b),使lcm(a, b)=n 注意数据范围n<= ...