自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 收藏
  • 关注

原创 css设置背景图片透明度

.demo{ position: relative; width: 500px; height: 300px; line-height: 50px; text-align: center; color: red;}.demo::before{ content: ""; position: absolute; left: 0; top: 0; z-index: -1; /*放在内容背后*/ width: 500px; height: 300px; background: ur

2021-08-08 22:32:17 6486

原创 WebStorm配置Typescript,在Html中使用

1、安装Typescriptnpm install typescript -g安装完成后在运行 tsc -v 可以查看安装的typescript版本,即安装成功2、设置webstorm languageFile -> Settings -> Language & Frameworks -> Typescript3、设置File WatchFile -> Settings -> Tools -> File Watchers起初没有 Watcher,

2021-05-14 13:34:23 1858 1

原创 Vue刷新页面的三种方式

1.原生的js刷新方式:location.reload();2.vue自带的路由跳转方式:this.$router.go(0);使用过后发现这俩种方式都会使页面有短暂的空白,体验效果不是特别好所以总结出了第三种方式3. 在app或者路由插槽处声明以下代码:<template> <div id="app"> <router-view v-if="isShow"/> </div></template><scr

2021-04-23 13:19:24 1421

原创 CSS超出文本显示省略号,获得光标显示全部内容

单行内容 overflow: hidden; // 超出的文本隐藏 text-overflow: ellipsis; // 溢出用省略号显示 white-space: normal; // 溢出不换行多行内容 overflow: hidden; // 超出的文本隐藏 text-overflow: ellipsis; // 溢出用省略号显示 display: -webkit-box; // //作为弹性伸缩盒子模型显示 -webkit-box-orient: vertical

2021-04-20 15:52:42 505

原创 vue中echarts报错 Cannot read property ‘init’ of undefined

vue中echarts报错 Cannot read property ‘init’ of undefined将代码import echarts from 'echarts'改为import * as echarts from 'echarts'

2021-04-14 14:07:02 134

原创 Vue子组件如何监听父组件值的变化

子组件中利用watch监听父组件值的变化// 子组件props: ["a"], watch: { a(oldValue, newValue) { // oldValue a旧值 // newValue a新值 } }

2021-04-04 10:51:57 2675

原创 vue如何在父组件中调用子组件的方法

假如子组件中有一个方法,想在父组件中直接调用、触发,这个时候就会用到ref属性子组件children中有一个方法jumpTrger()methods: { jumpTiger() {},在父组件中调用子组件,并加上ref属性// 在这里加上ref属性<children ref="child"></children>父组件的方法中this.$refs.refName.methodsFromChildren();methods: { jumpButton() {

2021-04-04 10:46:40 373

原创 Vue遍历数据(数组、字典)

数组:遍历其中数据<li v-for="item in items"> {{ item.message }}</li>数组:遍历数据及索引<li v-for="(item,index) of items"> {{ item.message }} + {{ index }}</li>字典:键 值 索引<li v-for="(value,key,index) in object"> {{ value }} {{key}}

2021-03-31 20:17:49 2709

原创 Vue log和标题放在同一行

<template> <div class="title-container"> <div> <el-image style="width: 100px; height: 100px; left: 10px" :src=shuLog fit="contain"> </el-image> <div class="title"> <span>xxxx平台</span&

2021-03-31 20:09:36 732

原创 JS 获取屏幕、浏览器、页面的高度宽度,设置容器高度

屏幕信息screen.height // 屏幕的高度screen.width // 屏幕宽度screen.availHeight // 屏幕可用高度:即屏幕高度减去上下任务栏后的高度,可表示为软件最大化时的高度任务栏高/宽度 :可通过屏幕高/宽度 减去 屏幕可用高/宽度得出。如:任务栏高度 = screen.height - screen.availHeight浏览器信息window.outerHeight // 浏览器高度window.outerWidth // 浏览器宽度window

2021-03-31 19:34:47 1036

原创 Vue的footer组件 可复用

Vue中抽取的footer组件,可复用<template> <div class="app-foot"> {{footerMsgCopyright}} <span class="source">{{footerMsgName}}</span> </div></template><script>export default { name: 'AppFoot', data() {

2021-03-31 19:03:29 1313

原创 vue页面显示图片

vue页面中显示图片,直接在src中指明图片路径,页面显示加载失败,下面介绍在vue页面中显示图片。html页面<div class="shu-log"> <el-image style="width: 100px; height: 100px" :src=shuLog fit="cover"> </el-image></div>script声明export default { name: 'L

2021-03-31 16:10:05 5852

原创 英语学术论文写作常用词汇

增补 additionin addition另外, furthermore此外, again, also, besides, moreover此外 , similarly, finally最后比较 comparisonin the same way, likewise同样地, similarly, equally, in comparison比较起来, just as同样地对照 contrastwhereas然而, in contrast与此相反, on the other hand, inst.

2021-03-15 16:02:21 1455

原创 i.e./e.g./aka的使用

i.e.i.e.表示“等同于”,其近似语是that is或者in other words。在写作中,i.e.表示进一步解释。先做一个陈述,再加i.e.,再接进一步解释,或者换个说法描述,或者打比方。The elephant is a pachyderm, i.e., a large animal with thick skin and nails on feet resembling hooves.i.e.可以用于列举所有的可能情况In our research we altered the .

2021-03-15 10:28:27 851

原创 python matplotlib在一张画布上画多个图

python matplotlib在一张画布上画多个图- fig.add_subplot()import matplotlib.pyplot as pltfig = plt.figure(figsize=(10, 10),dpi=100)# 图一ax1 = fig.add_subplot(2, 2, 1) #2行 2列 索引为1ax1.imshow(np.random.rand(5, 5), cmap=plt.cm.Blues)# 设置x轴和y轴的刻度ax1.set_xticks()a

2021-01-11 21:34:21 11023

原创 使用 imshow() 绘制矩阵

使用 imshow() 绘制矩阵基础的展示效果import matplotlib.pyplot as pltimport numpy as npmat = np.arange(0, 100).reshape(10, 10)plt.imshow(mat, cmap=plt.cm.Blues)plt.show()在画布上画多张图import matplotlib.pyplot as pltimport numpy as npfig = plt.figure(figsize=(10, 1

2021-01-11 21:06:07 1994

原创 python画图,需要书写希腊字母

采用Matplotlib模块画图时,横纵坐标或者标题如果要书写希腊字母,该如何处理这一问题。Matplotlib中支持LaTex语法,输入格式为:r’Δ\DeltaΔ’ #其中的Delta对应于希腊字母的Δr’Δ\DeltaΔrv’ #对应于ΔrvLaTex语法中希腊字母表:...

2021-01-05 15:15:31 3667

原创 统计numpy数组某个值的个数

data = np.array([0, 1, 2, 0, 0, 1, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 0])mask = np.unique(data)tmp = {}for v in mask: tmp[v] = np.sum(data == v)print("mask值为:")print(mask)print("统计结果:")print(tmp)结果:

2020-12-16 21:16:40 12033

原创 Overleaf 使用记录

Overleaf 使用记录Latex 基本用法基本用法Latex上下标、根号、分号指数或上标用^表示,下标用_表示,上下标如果多于一个字母或符号,需要用一对{ }括起来平方根号用\sqrt{ }表示​,其他根号的输入用命令\sqrt[“几次幂”]{ }分数用命令\fracLatex的点乘、叉乘、除以点乘:a \cdot b叉乘:a \times b除以:a \div bLatex 多行公式\begin{eqnarray*}\cos 2\theta & = & \

2020-10-29 20:03:57 10067

原创 from scipy.misc import comb ImportError: cannot import name ‘comb‘

因为scipy.misc中的comb位置已经移到scipy.special中,所以,将文件中错误的import修改就会没问题了。错误import路径为:Anaconda\lib\site-packages\sklearn\metrics\cluster\supervised.pyAnaconda\lib\site-packages\sklearn\model_selection_split.py所以打开这两个文件,修改import信息comb就可以了。...

2020-08-26 15:06:29 632

原创 读取文件的最后一行

def get_last_line_for_small_file(fname): with open(fname, 'r', encoding='utf-8') as f: # 打开文件 lines = f.readlines() # 读取所有行 first_line = lines[0] # 取第一行 last_line = lines[-1] # 取最后一行 print('文件' + fname + '第一行为:'+ fir

2020-08-26 13:03:42 1333

原创 将数据集划分为 训练集、验证集和测试集

将数据集划分为 训练集、验证集和测试集data::DataFrame 格式的数据ratio_train:训练集的比例ratio_test:测试集的比例ratio_val:验证集的比例from sklearn.model_selection import train_test_splitdef train_test_val_split(data, ratio_train, ratio_test, ratio_val): train, middle = train_test_split(

2020-08-26 12:40:03 11262

原创 DataFrame基础知识

初始化空的DataFrameimport pandas as pdempty_df = pd.DataFrame(columns=['A','B','C','D'])创建了四列,每一列的内容都是空的展示数据规模1、行数和列数df.shape2、按某一列名统计数据df.groupby('column_name').count()DataFrame数据拼接合并pd.merge()a=pd.DataFrame({'a':[1,2,3],'b':[2,3,4]})b=pd.Data

2020-08-26 12:29:54 21770

原创 Pycharm导入anaconda环境

Pycharm导入anaconda环境

2020-08-26 08:35:24 796

原创 读取文件夹里的文件路径

读取文件夹里的文件路径import os# 父文件夹/5个子文件夹/n个文件path = '/Users/Desktop/CEC'root = os.listdir(path) # 采用listdir来读取所有文件subFilesPath = []filePath = []for file_ in root: if os.path.isdir(path + '/' + file_): # 判断该文件是否是一个文件夹 subFilesPath.append(path + '/' +

2020-08-17 21:03:33 255

原创 SpringBoot实战

在官网https://start.spring.io/生成spring boot的模板在idea导入下载的springboot模版实战创建Controllerpackage com.example.controller;import org.springframework.stereotype.Controller;import org.springframework.we...

2020-03-03 14:09:43 139

原创 keep-alive遇见vue-router

keep-alive遇见vue-routerkeep-alive是Vue内置的一个组件,可以使被包含的组件保留状态,或避免重新渲染router-view也是一个组件,是vue-router的内置组件,如果直接被包在keep-alive里面,所有路径匹配到的视图组件都会被缓存...

2020-03-03 14:05:50 106

原创 Springboot使用记录

Map的使用java中Map集合的常用方法java中Map集合的常用方法Map<String,String> resultMap = new HashMap<>();resultMap.put("headName","");for(int ii=0;ii<scenedata.size();ii++){ System.out.println(scen...

2020-03-03 14:03:00 125

原创 vue+Springboot前后端交互问题

1. Vue ob: Observerob_: Observer这些数据是vue这个框架对数据设置的监控器,一般都是不可枚举的。假设list里面存放的就是那些带有__ob__: Observer的可以用下面代码解决```javascriptJSON.parse(JSON.stringify(this.list))```2. vue中实现先请求数据再渲染dom按照 请求数据—>...

2020-03-03 14:02:50 3251

原创 vue-context-menu 右击菜单 + 给eCharts增加右击效果 + 好看的右击菜单样式

安装npm install @xunlei/vue-context-menu在组件代码中引用<script>import { component as VueContextMenu } from '@xunlei/vue-context-menu'export default{ 'vue-context-menu': VueContextMenu}</scrip...

2020-03-01 15:27:58 6600 1

转载 报错Cannot truncate a table referenced in a foreign key constraint

清除表中数据的时候报错:Cannot truncate a table referenced in a foreign key constraint在删除之前执行:删除外键约束SET foreign_key_checks = 0删除删除表信息的方式有两种 :truncate table table_name;delete * from table_name;注 : t...

2020-02-25 18:10:09 2430

原创 macbook 下载maven 配置idea使用下载的maven

1、下载从maven官方网站下载maven官网下载地址2、设置环境变量配置环境变量,在.bash_profile中加入export M2_HOME=/Users/xxxxxx/document/apache-maven-3.6.3export PATH=$PATH:$M2_HOME/binM2_HOME里设置的是maven存放的位置3、设置阿里云镜像仓库在找到刚刚安装的mav...

2020-02-24 12:57:47 711

原创 el-select 报错 Missing required prop: "value"

element-ui el-select组件 使用报错Missing required prop: "value"<el-form-item label="进程"> <el-select placeholder="请选择"> <el-option v-for="item in process" :value="item.id" ...

2020-02-21 19:47:31 8085

原创 elementui 表格+分页器 展示数据

<template> <div> <el-table ref="filterTable" :data="tableData.slice((currpage - 1) * pagesize, currpage * pagesize)"> <el-table-column ...

2020-02-21 18:39:30 1110

原创 element-ui使用导航栏跳转路由

使用菜单栏进行路由跳转<el-menu :default-active="this.$route.path" class="el-menu-vertical-demo" router background-color="#708090" text-colo...

2020-02-21 16:18:43 1066

原创 js 将简体字转化成繁体字

在vue中将简体字转化成繁体字这段代码写在utils.js中function simpPYStr(){ return '啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔...

2020-02-20 21:19:01 3043

原创 vue+elementui 省区市三级联动+详细地址信息输入

1、安装依赖npm install element-china-area-data -S2、在组件内引入import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data'其中:...

2020-02-19 22:30:16 5107 3

原创 vue echarts中改变canvas长和宽 自适应

存放Echarts的DOM容器,如果给的高和宽是百分比,渲染的时候DOM容器的高和宽是按百分比给的,但是DOM容器下的子元素div和canvas高和宽是根据图标内容渲染。项目应用的时候,底部会有一部分DOM容器和div的高度差,不美观。希望Echarts的canvas和DOM容器的高宽一致。下面给出代码:<template> <div id="main"><...

2020-02-17 17:57:55 9451 2

转载 str.format()

format 函数可以接受不限个参数,位置可以不按顺序。>>>"{} {}".format("hello", "world") # 不设置指定位置,按默认顺序'hello world' >>> "{0} {1}".format("hello", "world") # 设置指定位置'hello world' >>> "{1}...

2020-02-15 11:22:14 96

原创 Python中json的使用

json串转成字典.loads()方法import json#引用json模块res=json.loads(s)print(res)#打印字典print(type(res))#打印res类型print(res.keys())#打印字典的所有Key先读文件,再转换f=open('stus.json',encoding='utf-8')content=f.read()#使用lo...

2020-02-15 11:19:19 354

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除