随笔分类 -  vue.js

vue 优化默认加载显示
摘要:来源 https://loading.io/css/ 原理 vue 没有加载初始化时, 显示的是 div="app" 中的 dom 内容, 优先加载一个 css 动画 css .app-loading-container { top: 0; bottom: 0; left: 0; right: 0; 阅读全文

posted @ 2024-03-18 16:37 正义的伙伴! 阅读(29) 评论(0) 推荐(0) 编辑

element-ui 样式问题处理
摘要:vue2+element 多选框多选时不换行(el-select组件)调整为鼠标左右滑动查看 .custom-select { max-width: 350px; display: flex; // see https://www.cnblogs.com/tohebe/p/17858737.html 阅读全文

posted @ 2024-02-04 11:45 正义的伙伴! 阅读(26) 评论(0) 推荐(0) 编辑

vue vue.config.js 配置
摘要:1. 开启 sourceMap // 显示 sourceMap , 便于调试 // process.env.NODE_ENV 有的是 dev/prod, 有的是 development/production, 需要自己确认下 productionSourceMap: process.env.NODE 阅读全文

posted @ 2023-11-02 13:28 正义的伙伴! 阅读(221) 评论(0) 推荐(0) 编辑

chrome 跨域问题解决
摘要:## 1. 后端设置了跨域, https 下可以, http 不可以 高版本 chrome 配置了策略, 如果访问私有网络, 会出现禁止跨域 chrome://flags/#block-insecure-private-network-requests Block insecure private 阅读全文

posted @ 2023-06-09 11:53 正义的伙伴! 阅读(318) 评论(0) 推荐(0) 编辑

package.json scripts 备忘
摘要:## 传参 ```sh ## -- 后面跟参数 ## 参考 https://stackoverflow.com/questions/11580961/sending-command-line-arguments-to-npm-script npm run pack -- -i ``` 阅读全文

posted @ 2023-06-01 17:38 正义的伙伴! 阅读(8) 评论(0) 推荐(0) 编辑

js 获取 image 原始高度
摘要:1. 新版浏览器 ```js // 这个 api 仅支持新版本浏览器, 旧版还是得创建一个内部图片 setTimeout(() => { let imgRef = this.$refs.img this.imgWidth = imgRef.naturalWidth this.imgHeight = 阅读全文

posted @ 2023-05-30 16:27 正义的伙伴! 阅读(52) 评论(0) 推荐(0) 编辑

vue 常用动画
摘要:来源: https://juejin.cn/post/6844903638402334734 Vue 常用 transition 动画效果记录 我的代码果然有问题 2018年07月15日 13:48 · 阅读 3839 先简单介绍下 transition 标签的使用方法 主要用于 v-show, v 阅读全文

posted @ 2023-04-04 13:03 正义的伙伴! 阅读(53) 评论(0) 推荐(0) 编辑

echarts 饼图位置调整
摘要:设置echarts饼状图大小:一、控制大小;series下的 radius : [‘54%’, ‘90’], 这个属性设置图的大小;第一个参数是控制里面小圈的大小,第二个参数是控制外面大圈的大小;举例: radius: ['40%','60%'],1 radius: ['40%','90%'],1 阅读全文

posted @ 2023-03-15 16:03 正义的伙伴! 阅读(4840) 评论(0) 推荐(0) 编辑

vue (或者 javascript ) 打印彩色日志
摘要:type Any = any /** * 创建 console 所需的 style 样式 * @param bgColor * @param fontColor */ const createStyle = function(bgColor: string, fontColor = '#fff'): 阅读全文

posted @ 2023-03-10 09:48 正义的伙伴! 阅读(438) 评论(0) 推荐(0) 编辑

node.js 前端 node-sass 安装失败解决方案
摘要:在 github 页面 https://github.com/sass/node-sass/releases 中直接下载文件, 然后设置 windows 环境变量 SASS_BINARY_PATH=C:\data\env\nodejs-lib\win32-x64-93_binding.node 阅读全文

posted @ 2022-09-17 11:31 正义的伙伴! 阅读(67) 评论(0) 推荐(0) 编辑

echarts 备忘
摘要:1. 画线 参考: https://echarts.apache.org/examples/zh/editor.html?c=scatter-anscombe-quartet&lang=js 示例代码 const markLineOptFactory = (start = [0.3, 0], end 阅读全文

posted @ 2022-08-18 10:48 正义的伙伴! 阅读(49) 评论(0) 推荐(0) 编辑

vue 打包 js css 添加 hash
摘要:vue项目打包文件增加hash值 (vue-cli 3 无需额外的配置) vue-cli2项目 修改vue项目根目录下的 build/webpack.prod.conf.js文件 js文件: output: { path: config.build.assetsRoot, filename: uti 阅读全文

posted @ 2022-02-23 13:50 正义的伙伴! 阅读(2365) 评论(0) 推荐(0) 编辑

ckeditor5 集成问题
摘要:1. mathType 保存图片回显无法更新问题 ckeditor5 会将属性解析到 span(inline) ,或者 figure 上(block), 这时候需要自己写个插件配置下。 参考: https://ckeditor.com/docs/ckeditor5/latest/framework/ 阅读全文

posted @ 2022-01-27 22:32 正义的伙伴! 阅读(171) 评论(0) 推荐(0) 编辑

vue-cli 3 编译时 css 放在 body 里
摘要:修改 vue.config.js // https://stackoverflow.com/questions/58263664/vue-js-inject-styles-in-body-instead-of-head-of-index-html-webpack-htmlweb class Inje 阅读全文

posted @ 2022-01-13 12:31 正义的伙伴! 阅读(271) 评论(0) 推荐(0) 编辑

js location.href 循环下载问题
摘要:location.href 循环只能下载最后一次的文件, 使用如下代码 var a = document.createElement('a');//在dom树上创建一个a标签 var url = url a.href = url;//将url赋值给a标签的href属性 a.download = '入 阅读全文

posted @ 2021-10-14 09:38 正义的伙伴! 阅读(736) 评论(0) 推荐(0) 编辑

promise 相关
摘要:1. promise 的 catch 并不能处理 异常!,需注意, 应该用 reject 而不是 throw 抛出异常 阅读全文

posted @ 2021-08-26 14:13 正义的伙伴! 阅读(14) 评论(0) 推荐(0) 编辑

vue 配置 tslint .
摘要:module.exports = { root: true, parser: 'vue-eslint-parser', parserOptions: { 'sourceType': 'module',// 修改这里 为 @typescript-eslint/parser............... 阅读全文

posted @ 2021-08-24 15:50 正义的伙伴! 阅读(268) 评论(0) 推荐(0) 编辑

vue 配置 history 模式
摘要:后端配置例子 注意:下列示例假设你在根目录服务这个应用。如果想部署到一个子目录,你需要使用 Vue CLI 的 publicPath 选项 (opens new window)和相关的 router base property (opens new window)。你还需要把下列示例中的根目录调整成 阅读全文

posted @ 2021-07-07 09:36 正义的伙伴! 阅读(762) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
//增加一段JS脚本,为目录生成使用
点击右上角即可分享
微信分享提示