vue界面传值(子父组件)
来源:互联网 发布:ktv小姐怎么出台 知乎 编辑:程序博客网 时间:2024/06/14 06:28
父组件
<template> <div> <div class="rootViewstyle"> <titleview model="1123" @touch="touchbtn"></titleview> </div> </div></template><script> import titleview from "./thePaperTitleView.vue" export default { components: { titleview }, data () { return {} }, methods: { touchbtn(one,two) { alert(two) } }, }</script><!-- Add "scoped" attribute to limit CSS to this component only --><style scoped> .rootViewstyle { margin: 20px 20px; background-color: white; }</style>
子组件
<template> <div class="titleViewstyle"> <div id="titleshilinestyle"></div> <!--头视图内容--> <h4 align="center"> <span class="titlenamestyle"> {{model}}: <strong class="titleContentstyle">数学 </strong> </span> <span class="titlenamestyle"> 考试时间: <strong class="titleContentstyle">2016-12-08 11:01:14 </strong> </span> <span class="titlenamestyle"> 监考教师: <strong class="titleContentstyle">暂无 </strong> </span> <span class="titlenamestyle"> 总题数: <strong class="titleContentstyle">12题 </strong> </span> <span class="titlenamestyle"> 判卷老师: <strong class="titleContentstyle">王木木 </strong> </span> </h4> <!--虚线--> <div style="border-bottom: 1px dashed #ecf1f9; margin: 20px 20px"></div> <span class="titlenamestyle"> 客观部分:16分 </span> <div style="border-bottom: 1px solid #ecf1f9; margin: 20px 20px"></div> <button @click="touchbtnone"> 确定</button> </div></template><script> export default { name: 'hello', props:['model'], data () { return {} }, methods:{ touchbtnone() { this.$emit('touch',"123","333") } } }</script><!-- Add "scoped" attribute to limit CSS to this component only --><style scoped> .titleViewstyle { height: 300px; } #titleshilinestyle { height: 50px; margin-bottom: 20px; border-bottom: 1px solid #ecf1f9; } .titleContentstyle { color: #636363; } .titlenamestyle { font-size: 18px; font-weight: normal; padding: 20px; }</style>
阅读全文
0 0
- vue界面传值(子父组件)
- VUE 父组件向子组件传值,子组件向父组件传值
- vue-prop父组件向子组件进行传值
- vue-子组件向父组件传值
- vue子组件向父组件传值问题
- Vue父组件调用子组件事件
- Vue 父组件与子组件
- vue-父组件获取子组件数据
- vue 父组件调用子组件方法
- vue子组件获取父组件方法
- EasyDSS流媒体服务器web前端:vue组件之间的传值,父组件向子组件传值
- EasyDSS RTMP流媒体服务器web前端:vue组件之间的传值,父组件向子组件传值
- Vue.js的组件(二)父组件与子组件的数据联系 之 父传子
- 前端框架Vue(8)——子父组件的传参通信
- Vue--- 子 --> 父 组件传递参数
- Vue父组件向子组件传递一个动态的值,子组件如何保持实时更新实时更新?
- vue组件传值
- 【vue.js】子组件的参数值不随着父组件值的改变而改变
- GetClientRect用法
- FTP虚拟用户名模式
- Spark的广播变量和累加变量
- java--泛型擦除
- php 文件写入 文件最加内容
- vue界面传值(子父组件)
- DB2数据库SQL1366N错误处理
- Android自定义菊花进度条
- UIFont的lineHeight与pointSize
- spring框架详解(五)--AOP注解形式
- python创建数组
- O(1)快速乘
- LCD调试问题总结
- 9/15日JavaScript笔记