<template> <div> <div class="right"> <div style="height: 50px"> <div class="title">{{data.name}} <el-image :src="img" style="width: 30px;height: 30px;margin: 0px 5px"/> {{data.value}} <div class="btn" @click="setting">设 置</div> </div> </div> <overview style="flex: 1;width: 100%;"/> </div> <setting v-show="editShow" ref="setting" @watchChild="" /> </div> </template> <script> import Overview from "./overview"; import Setting from "../setting/setting"; export default { name: 'Right', components: {Overview,Setting}, data() { return { img:require('@/assets/images/green.png'), editShow: false, // 编辑组件是否显示 data:{ name: '天通卫星通信', value: '666kb/s' } } }, created() { }, methods: { setting(){ this.editShow = true this.$refs.setting.initDialog('create') } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .right{ display: flex; flex-direction: column; height: 100%; width:100%; .title{ margin: 0px 0px 0px 50px; color: white; font-size: 18px; display: flex; height: 30px; line-height: 30px; text-align: center; position: absolute; right: 50px; .btn{ color: white; font-size: 16px; cursor: pointer; width: 200px; margin-left: 20px; height: 30px; line-height: 30px; background: url("../../assets/images/button.png") no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; &:hover{ background: url("../../assets/images/button1.png") no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; color: #00f5ff; } } } } </style>