巨丑vue
<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的更多相关文章
- 去除IE10+上文本框巨丑无比的删除图标以及显示密码图标
去除IE10+上文本框巨丑无比的删除图标以及显示密码图标 IE浏览器总是让人喜欢让人厌,在最新的IE浏览器(IE10+)上使用表单时,文本框内后面会出现很巨丑无比的“删除图标”以及“显示密码图标”,如 ...
- 牢骚 - 你代码写得丑,又不肯用好一点的IDE,这让我很为难啊。
又有人问我代码错误,发过来就是一篇巨丑无比的代码,先不说左大括号转行还和代码写在同一行的谭浩强风格,你这狗啃的一样的缩进是闹哪样!粘进VS2015里面,自动格式化,瞬间赏心悦目,编译错误出了5行,我直 ...
- vue-router的hash模式与history模式的对比
Vue-router 中hash模式和history模式的关系在vue的路由配置中有mode选项 最直观的区别就是在url中 hash 带了一个很丑的 # 而history是没有#的mode:&quo ...
- Vue-router 中hash模式和history模式的区别
实际上存在三种模式: Hash: 使用URL的hash值来作为路由.支持所有浏览器. History: 以来HTML5 History API 和服务器配置.参考官网中HTML5 History模式 ...
- H5坦克大战之【画出坦克】
今天是个特殊的日子,圣诞节,也是周末,在这里先祝大家圣诞快乐!喜庆的日子,我们可以稍微放松一下,扯一扯昨天雷霆对战凯尔特人的比赛,这场比赛大威少又双叒叕拿下三双,而且是一个45+11+11的超级三双, ...
- 东哥读书小记 之 《MacTalk人生元编程》
一直以来的自我感觉:自己是个记性偏弱的人.反正从小读书就喜欢做笔记(可自己的字写得巨丑无比,尼玛不科学呀),抄书这事儿真的就常发生俺的身上. 因为那时经常要背诵课文之类,反正为了怕自己忘记, ...
- 综合实战--文件上传系统【JDBC&IO&Socket】
本文纯属记录第一次实战遇到的坑和知识,如果后边有时间再做整理. 1,先写了个操作数据库的工具类SqlTool,照着JDBC资料打完之后,测试的时候出错了,java.lang.ClassNotFound ...
- 李洪强iOS经典面试题140-UI
李洪强iOS经典面试题140-UI UI viewcontroller的一些方法的说明viewDidLoad,viewWillDisappear, viewWillAppear方法的 顺序和作用? ...
- second class
nothing no very good. 1.look at shuruo.html,after display:inline-block; li's width as the content; S ...
随机推荐
- luogu题解 P3629 【[APIO2010]巡逻】树的直径变式
题目链接: https://www.luogu.org/problemnew/show/P3629 分析 最近被众多dalao暴虐,这道题傻逼地调了两天才知道错哪 不过这题比较良心给你一个容易发现性质 ...
- .NET 使用事物调用存储过程
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using ...
- 如何上传HTML5应用到SAP云平台的Cloud Foundry环境下
先使用WebIDE创建一个HTML5应用.New->Project from Template: 从可选模板里选择SAPUI5 Application: 创建一个HTML5 Module,取名为 ...
- Win10 通过附加进程调试时出现“此任务要求应用程序具有提升的权限”
最近有新人在使用vs调试时出现了“此任务要求应用程序具有提升的权限”的提示,每次调试vs就会重启一次. 问到我时,我经过查了一番资料才给解决掉了. 其实,问题主要是因为直接启动vs项目时没有足够的权限 ...
- 程序员和IT员不能错过的网站
前言本文收录一些值得收藏的开发相关网站. 目录一.搜索引擎二.在线课程三.在线练习四.在线工具箱五.在线编译器六.技术论坛或社区七.音乐放松一下 一.搜索引擎搜索引擎大家最熟悉不过,本没有必要列出,但 ...
- 微信公众号开发(三)—— access_token的管理
上一篇 微信公众号开发(二)—— 微信公众平台接入 让我们的本地工程顺利的接入到微信公众号系统, 那么接下啦我们介绍一个很重要的感念——acess_token (access_token是公众号的全局 ...
- [Abp vNext微服务实践] - 添加中文语言
简介 abp vNext中提供了多语言功能,默认语言是英文,没有提供中文语言包.在业务开发中,定义权限后需要用中文的备注提供角色选择,本篇将介绍如何在abp vNext中加入中文语言. step1:添 ...
- 算法笔记--CDQ分治 && 整体二分
参考:https://www.luogu.org/blog/Owencodeisking/post-xue-xi-bi-ji-cdq-fen-zhi-hu-zheng-ti-er-fen 前置技能:树 ...
- 利用Struts上传文件
在利用struts2完成上传文件到服务器时,遇到获取不到文件名 原因是在Action中的属性名没有和jsp中的属性名匹配 <%@ page language="java" i ...
- 《深入理解Java虚拟机》之(二、垃圾收集器与内存分配策略)
程序计数器.虚拟机栈.本地方法栈3个区域随线程而生,随线程而灭,这几个区域的内存分配和回收都具备确定性,不需要过多考虑回收的问题,因为方法结束或者线程结束时,内存自然就跟着回收了,而java堆和方法区 ...