vue组件3-父子组件props传参
来源:互联网 发布:2017淘宝店铺开店流程 编辑:程序博客网 时间:2024/06/05 18:28
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>父子组件传参-props</title>
</head>
<script src="vue.js"></script>
<body>
<div id="app1">
<parent></parent>
</div>
<script>
Vue.component('child', {
// 声明 props
props: ['message'],
template: '<span>{{ message }}</span>'
template:'<div><child message="我是子元素"></child></div>'
})
new Vue({
el:"#app1"
})
</script>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>父子组件传参-props</title>
</head>
<script src="vue.js"></script>
<body>
<div id="app1">
<parent></parent>
</div>
<script>
Vue.component('child', {
// 声明 props
props: ['message'],
template: '<span>{{ message }}</span>'
})
//父子组件props传参子组件中可以使用props:['myMessage'],在父组件引用子组件时,使用my-message ="xx"
Vue.component('parent',{template:'<div><child message="我是子元素"></child></div>'
})
new Vue({
el:"#app1"
})
</script>
</body>
</html>
阅读全文
0 0
- vue组件3-父子组件props传参
- Vue组件选项props
- 父子组件通信-props属性
- vue组件4-props传参2
- vue 分页组件及props传参
- vue组件学习6(props传参)
- vue 父子组件通讯--props,refs(muse-ui,vue.js2.0)
- vue 父子组件通信
- vue父子组件通信
- Vue父子组件通信
- Vue父子组件通信
- Vue父子组件创建
- vue父子组件中传值
- vue父子组件通信
- 【react】父子组件之间通讯props
- vue父子组件的嵌套
- Vue.js 父子组件通讯
- 父子组件通信vue.js
- 使用Mybatis-Generator自动生成代码
- Ancient Cipher,NEETC 2004,UVa1339
- 使用FormData对象提交表单-上传附件
- 数组作为实参传给函数的形参指针
- 精确度,准确率,召回率,漏警概率,虚警概率
- vue组件3-父子组件props传参
- OpenJudge 2.5-1481 Maximum sum(最大和)
- 【BZOJ】3110 [Zjoi2013]K大数查询 整体二分+树状数组 || 树套树
- laravel启动顺序
- ASM ClassReader failed to parse class file
- Docker + CentOs7
- 日期注解格式
- 史上最全WebView使用,附送Html5Activity一份
- java向上转型妙用