<template>
<div>
<div class="demo-type" align="right" style="height: 78px">
<div style="float:left;margin-top: 10px">
<img src="../../static/img/logo.png"></img>
</div>
<div style="float:right;margin-right: 20px;margin-top: 7px;">
<el-col :span="1">
<div class="sub-title">circle</div>
<div class="demo-basic--circle">
<el-avatar :src="circleUrl"></el-avatar>
</div>
</el-col>
</div>
</div>
<el-menu style="height: 10px" mode="horizontal">
</el-menu>
<div class="line"></div>
<div style="width: 200px;float: left;border: 1px solid yellow">
<el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
<el-radio-button :label="false">展开</el-radio-button>
<el-radio-button :label="true">收起</el-radio-button>
</el-radio-group>
<el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
<el-submenu index="1">
<template slot="title">
<i class="el-icon-location"></i>
<span slot="title">菜单管理</span>
</template>
<el-menu-item-group>
<el-menu-item index="1-1" @click="addTab(editableTabsValue,'后台菜单','http://localhost:8080/#/test',1)">后台菜单</el-menu-item>
<el-menu-item index="1-2" @click="addTab(editableTabsValue,'前台菜单','http://localhost:8080/#/test2',2)">前台菜单</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="2">
<template slot="title">
<i class="el-icon-menu"></i>
<span slot="title">内容管理</span>
</template>
<el-menu-item-group>
<el-menu-item index="2-1" @click="addTab(editableTabsValue,'文章管理','http://localhost:8080/#/test4',3)">文章管理</el-menu-item>
<el-menu-item index="2-2" @click="addTab(editableTabsValue,'单页管理','http://localhost:8080/#/test3',4)">单页管理</el-menu-item>
</el-menu-item-group>
</el-submenu>
<!--<el-menu-item index="2">
<i class="el-icon-menu"></i>
<span slot="title">内容管理</span>
</el-menu-item>
<el-menu-item index="3" disabled>
<i class="el-icon-document"></i>
<span slot="title">导航三</span>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon-setting"></i>
<span slot="title">导航四</span>
</el-menu-item>-->
</el-menu>
</div>
<div style="margin-left:210px;width:84%;height: 100%;border: 1px solid black" align="center">
<div style="border: 1px solid #F00">
<el-tabs v-model="editableTabsValue" @tab-click="clickTab(editableTabsValue)" type="card" closable @tab-remove="removeTab">
<el-tab-pane
v-for="(item, index) in editableTabs"
:key="item.name"
:label="item.title"
:name="item.name"
>
</el-tab-pane>
</el-tabs>
</div>
<div style="">
<iframe :src="src" id="mobsf" frameborder="1" style="position:absolute;left: 220px;width: 100%;height: 100%"></iframe>
</div>
</div>
</div>
</template> <script>
export default {
data() {
return {
activeIndex: '1',
activeIndex2: '1',
circleUrl: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
isCollapse: true,
editableTabsValue: '0',//标签数量
editableTabs: [],//标签集合
tabIndex: 0,
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
src:''
};
},
mounted:function(){ },
methods: {
//添加标签
addTab(targetName,title,src,count) {
for (var i=0;i<this.editableTabs.length;i++){
if(this.editableTabs[i].title==title){
this.editableTabsValue=count+"";
//alert(" tabIndex: "+this.tabIndex);
this.src=src;
return;
}
}
let newTabName = count + '';
// alert("newTabName: "+newTabName+" tabIndex: "+this.tabIndex);
//alert(this.tabIndex);
this.editableTabs.push({
title: title,
name: newTabName,
src:src
});
this.src=src;
this.editableTabsValue = newTabName;
},
//删除标签
removeTab(targetName) {
//alert(1);
let tabs = this.editableTabs;
let activeName = this.editableTabsValue;
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
let nextTab = tabs[index + 1] || tabs[index - 1];
if (nextTab) {
activeName = nextTab.name;
}
}
});
} this.editableTabsValue = activeName;
this.editableTabs = tabs.filter(tab => tab.name !== targetName);
},
clickTab:function (editableTabsValue) {
// alert(editableTabsValue);
this.src=this.editableTabs[editableTabsValue-1].src;
} }
}
</script> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px;
min-height: 400px;
}
body{margin:0; padding:0;height: 100%;width: 100%;}
</style>

巨丑vue的更多相关文章

  1. 去除IE10+上文本框巨丑无比的删除图标以及显示密码图标

    去除IE10+上文本框巨丑无比的删除图标以及显示密码图标 IE浏览器总是让人喜欢让人厌,在最新的IE浏览器(IE10+)上使用表单时,文本框内后面会出现很巨丑无比的“删除图标”以及“显示密码图标”,如 ...

  2. 牢骚 - 你代码写得丑,又不肯用好一点的IDE,这让我很为难啊。

    又有人问我代码错误,发过来就是一篇巨丑无比的代码,先不说左大括号转行还和代码写在同一行的谭浩强风格,你这狗啃的一样的缩进是闹哪样!粘进VS2015里面,自动格式化,瞬间赏心悦目,编译错误出了5行,我直 ...

  3. vue-router的hash模式与history模式的对比

    Vue-router 中hash模式和history模式的关系在vue的路由配置中有mode选项 最直观的区别就是在url中 hash 带了一个很丑的 # 而history是没有#的mode:&quo ...

  4. Vue-router 中hash模式和history模式的区别

    实际上存在三种模式: Hash: 使用URL的hash值来作为路由.支持所有浏览器. History: 以来HTML5 History API 和服务器配置.参考官网中HTML5 History模式 ...

  5. H5坦克大战之【画出坦克】

    今天是个特殊的日子,圣诞节,也是周末,在这里先祝大家圣诞快乐!喜庆的日子,我们可以稍微放松一下,扯一扯昨天雷霆对战凯尔特人的比赛,这场比赛大威少又双叒叕拿下三双,而且是一个45+11+11的超级三双, ...

  6. 东哥读书小记 之 《MacTalk人生元编程》

         一直以来的自我感觉:自己是个记性偏弱的人.反正从小读书就喜欢做笔记(可自己的字写得巨丑无比,尼玛不科学呀),抄书这事儿真的就常发生俺的身上. 因为那时经常要背诵课文之类,反正为了怕自己忘记, ...

  7. 综合实战--文件上传系统【JDBC&IO&Socket】

    本文纯属记录第一次实战遇到的坑和知识,如果后边有时间再做整理. 1,先写了个操作数据库的工具类SqlTool,照着JDBC资料打完之后,测试的时候出错了,java.lang.ClassNotFound ...

  8. 李洪强iOS经典面试题140-UI

    李洪强iOS经典面试题140-UI   UI viewcontroller的一些方法的说明viewDidLoad,viewWillDisappear, viewWillAppear方法的 顺序和作用? ...

  9. second class

    nothing no very good. 1.look at shuruo.html,after display:inline-block; li's width as the content; S ...

随机推荐

  1. myEclipse10安装以及破解

    这里需要下载一个破解补丁 https://pan.baidu.com/s/1ivE2yauZRDdDq8zBxpK06A 可以去网盘里下载, 下载后解压,会有如下文件 然后运行run.bat,会出现这 ...

  2. 【QT学习笔记】二、信号槽和自定义信号槽

    1. 信号槽 int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton button("Qui ...

  3. Centos7.7安装swoole

    系统版本:centos 7.7(查看系统版本:cat /etc/redhat-release) 执行命令安装swoole: yum update -y && yum remove ph ...

  4. java程序启动极慢的问题处理

    在程序部署过程中,遇到一次java程序启动极慢的情况 参考:https://www.iteye.com/blog/windshome-1836885 原部署环境是有外网的,启动java极快 后来极其修 ...

  5. 使用PHP 格式化时间

    date 用法: date(格式,[时间]); 如果没有时间参数,则使用当前时间. 格式是一个字符串,其中以下字符有特殊意义: U 替换成从一个起始时间1970年1月1日以来的秒数 <?php ...

  6. Matlab修改数值格式/精度/小数位数

    ————————————命令行方法————————————— 直接在命令行中输入以下命令,但该命令不影响数据的存储形式和计算精度,下次还需进行修改. format 默认格式  format short ...

  7. 使用 visual studio 2019 社区版打开touchgfx工程注意项

    @2019-09-23 [环境] touchgfx designer 4.10.0 visual studio 2019 社区版 [问题] #error 1 使用 visual studio 2019 ...

  8. 05_ Flume多级Agent之间串联案例

    多级agent之间串联: 从tail命令获取数据发送到avro端口,另一个节点可配置一个avro源来获取数据,发送外部存储 启动两个Agent节点: 使用scp命令拷贝flume安装包到另一台虚拟机; ...

  9. 编译原理实战——使用Lex/Flex进行编写一个有一定词汇量的词法分析器

    编译原理实战--使用Lex/Flex进行编写一个有一定词汇量的词法分析器 by steve yu 2019.9.30 参考文档:1.https://blog.csdn.net/mist14/artic ...

  10. linux基础_用户组的管理

    1.创建组 语法:groupadd 组名 2.删除组 语法:groupdel 组名 3.创建用户时,直接指定组 语法:useradd -g 用户组 用户名 4.修改用户的组 语法:usermod -g ...