- 博客(9)
- 收藏
- 关注
原创 2021-01-05
document.documentElement 获取当前html这个标签document.body 获取当前body这个标签document.documentElement.classList.add() 给当前html添加类名
2021-01-05 14:09:59
107
原创 vue 中image引入图片或者svg失败
1.引入图片失败可以通过import导入 然后将它变成data中的数据,再在img中绑定<template> <img :src="imgUrl" alt="" class="login-image" /></template>import img from '../../assets/images/login/base_copy.png';<script> export default { data(){ return { img
2020-12-28 16:04:24
2001
原创 antd的menu菜单的一级标题互斥延伸
onOpenChange(openKeys) { const latestOpenKey = openKeys.find( (key) => this.openKeys.indexOf(key) === -1 ); function getParent(data, id) { var temp = []; let originData = data; function forFn(arr, id) {
2020-12-18 10:41:32
444
原创 2020-12-17
数据类似这种.想要将其中的menuId和parentId以及children取出. getAllId(tree) { function getData(menuData) { let arr = []; menuData.forEach((item) => { if (item.children) { arr.push({ menuId: item.menuId, .
2020-12-17 09:58:58
122
1
原创 解决树节点获取当前id和parentId的方法
节点数据类似这种function getParent(data, id) { var temp = []; let originData = data; function forFn(arr, id) { arr.forEach((item) => { if (item.menuId == id && item.parentId != 0) { temp.push.
2020-12-17 09:36:37
2265
1
原创 自定义echarts组件中的工具栏
1.导出图片 let url = this.myChart.getData(); // 此处的myChart是图表的实例 var $a = document.createElement('a'); $a.download = `${this.myChart.option.title.text}.png`; $a.target = '_blank'; $a.href = url; var evt = new MouseEvent('clic
2020-12-15 10:40:53
452
原创 在ant中使用自定义svg的icon
可以通过componet组件这个属性去自定义icon,例如:const SearchSvg = {template: <svg xmlns="http://www.w3.org/2000/svg" width="17.348" height="18.323" viewBox="0 0 17.348 18.323"> <path id="search" d="M1690.44,688.365a.684.684,0,0,0,.967-.967l-2.677-2.678a8.578,8.5
2020-12-04 10:53:54
2213
原创 如何使用window.open打开页面并刷新
1.将自己需要跳转的页面定义个变量let mywin = window.open(previewUrl, “index”);2.将这个变量通过location的方法,并传值true让它获取最新的内容mywin.location.reload(true);
2020-11-11 09:48:28
4832
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人