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 ...
随机推荐
- javascript 获取指定范围随机数
<script type="text/javascript"> function GetRandomNum(Min,Max){ var Range = Max - Mi ...
- nmq 提交到 npm
安装npm install nmq 源码:https://github.com/ronwe/nmq 此版本提供 pub/sub , 优化 pull
- Linux开放1521端口允许网络连接Oracle Listener
症状: 1. TCP/IP连接是通的.可以用ping 命令测试. 2. 服务器上Oracle Listener已经启动. lsnrctl status 查看listener状态 lsnrct ...
- DB-MySQL:MySQL 语句性能优化
ylbtech-DB-MySQL:MySQL 语句性能优化 1.返回顶部 1. MySQL概述1.数据库设计 3范式2.数据库分表分库---会员系统() 水平分割(分页如何查询)MyChar .垂直3 ...
- 你务必知道的css简写
欢迎加入前端交流群来py:749539640 简写属性是可以让你同时设置其他几个 CSS 属性值的 CSS 属性.使用简写属性,Web 开发人员可以编写更简洁.更具可读性的样式表,节省时间和精力. ...
- angular4(2-1)angular脚手架引入第三方类库(jquery)
欢迎加入前端交流群交流知识&&获取视频资料:749539640 如何在angular4脚手架中引入第三方类库呢比如jquery.swiper.bootstrap...... 例如引入j ...
- 91.Bower : ENOGIT git is not installed or not in the PATH 解决方法
转自:https://www.haorooms.com/post/bower_error 今天在用bower安装依赖的时候,出现了Bower : ENOGIT git is not installed ...
- 网线直连Window和Ubuntu
找根网线直接连接两台电脑. 然后设置对应的网络到相同的网关和Mask下面. 检测能否ping通就可以直连了. Ubuntu设置网络后可在IP设置界面里设置Route, 选择直连网线仅用于连接 ...
- ubuntu修改顶栏颜色
title: ubuntu修改顶栏颜色 toc: false date: 2018-09-29 19:14:01 categories: methods tags: Ubuntu 编辑shell主题的 ...
- SpringBoot学习笔记(4)----SpringBoot中freemarker、thymeleaf的使用
1. freemarker引擎的使用 如果你使用的是idea或者eclipse中安装了sts插件,那么在新建项目时就可以直接指定试图模板 如图: 勾选freeMarker,此时springboot项目 ...