随笔分类 -  Vue

摘要:记录曾经需求实现的软件更新时间线demo,代码稀烂,仅为记录 GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/timeLine 示例: 代码: <!--版本更新--> <template> 阅读全文
posted @ 2021-03-31 15:04 bugSource 阅读(94) 评论(0) 推荐(0)
摘要:由于是从主体上拆分出来的,逻辑可能有点乱,主要是记录下拉框如何获取四级JSON数据。 三级、四级联动JSON数据在GitHub里下载吧,原地址忘了 GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/pa 阅读全文
posted @ 2021-03-31 13:50 bugSource 阅读(812) 评论(1) 推荐(0)
摘要:前言 据网上流传,有关Vue组件重新渲染的方案往往存在如下四种。 1、借助route机制,刷新整个页面 2、使用v-if,将组件销毁、重新加载 3、使用内置的forceUpdate方法 4、使用key-changing优化组件 前两种没什么好说的,并且考虑到效率问题,本次主要是记录forceUpda 阅读全文
posted @ 2021-03-31 13:48 bugSource 阅读(1138) 评论(0) 推荐(0)
摘要:记录el-tree实现选中触摸等样式效果 GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/treeTouch 示例: 代码: <template> <div class="employee" 阅读全文
posted @ 2021-03-31 10:46 bugSource 阅读(426) 评论(0) 推荐(0)
摘要:记录el-table触摸头部出现图标(忘记当初为什么要写这个demo) GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/tableHeadTouch 示例: 代码: <template> < 阅读全文
posted @ 2021-03-31 10:43 bugSource 阅读(118) 评论(0) 推荐(0)
摘要:记录只用el-checkbox根据el-tag实现初始化界面时数据反显 GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/checkboxShow 示例: 代码: <template> <di 阅读全文
posted @ 2021-03-31 10:41 bugSource 阅读(1024) 评论(0) 推荐(0)
摘要:前言 记录Vue的路由传参方法 参数在url路径上显示 方法一 $router.push传参 //传参: this.$router.push({ path: '/xxxxxxxx', query: { str: '传过去的值' }}) //接收: this.string = this.$route. 阅读全文
posted @ 2021-03-31 10:40 bugSource 阅读(216) 评论(0) 推荐(0)
摘要:vue总线机制(bus) vue中非父子组件之间通信除了使用vuex,也可以通过bus总线,两者适用场景不同。 bus适合小项目、数据被更少组件使用的项目,对于中大型项目 数据在很多组件之间使用的情况 bus就不太适用了。bus其实就是一个发布订阅模式,利用vue的自定义事件机制,在触发的地方通过$ 阅读全文
posted @ 2021-03-30 17:50 bugSource 阅读(691) 评论(0) 推荐(0)
摘要:###官网:http://www.sortablejs.com/index.html Sortable.js是一款轻量级的拖放排序列表的js插件。支持ie9及以上版本ie浏览器和现代浏览器,也可以运行在移动触摸设备中。不依赖jQuery。支持 Meteor、AngularJS、React、Vue、K 阅读全文
posted @ 2021-03-30 15:15 bugSource 阅读(397) 评论(0) 推荐(0)
摘要:记录el-upload实现上传图片的过程 GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/imgElUpload 示例: 代码: <template> <div> <el-upload cl 阅读全文
posted @ 2021-03-30 13:48 bugSource 阅读(251) 评论(0) 推荐(0)
摘要:记录一个刷新后仍然有效的倒计时demo GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/countDown 示例: 代码: <template> <div style="width: 100 阅读全文
posted @ 2021-03-29 15:01 bugSource 阅读(41) 评论(0) 推荐(0)
摘要:前言 整理几种props的使用方式 第一种 传递一个数组 props:["cont"] 第二种 传递一个对象 props:{ uploadOption:{ type:Object, //参数类型必须是一个对象 required: true //这一种说明这个参数是必须的哈 } } 第三种 整理各类型 阅读全文
posted @ 2021-03-29 14:20 bugSource 阅读(726) 评论(0) 推荐(0)
摘要:GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/clickChangeStyle 示例: 思路:通过点击事件把对应的index赋值给nowIndex,通过:class把nowIndex = 阅读全文
posted @ 2021-03-29 14:09 bugSource 阅读(1138) 评论(0) 推荐(0)
摘要:调用搜狐接口获取用户ip地址 ####GitHub项目Demo地址:https://github.com/Beingyo/vue-test-template/tree/main/src/page/getUserIP ####示例: 代码: <template> <div style="width: 阅读全文
posted @ 2021-03-29 13:58 bugSource 阅读(168) 评论(0) 推荐(0)
摘要:1. 业务场景 由前台导入Excel表格,获取批量数据。根据一个数组导出Excel表格。 2.1 引入工具库 npm install xlsx --save npm install file-saver --save npm install script-loader --save-dev 2.2 阅读全文
posted @ 2021-03-29 11:49 bugSource 阅读(416) 评论(0) 推荐(0)
摘要:关于v-html中存在<img>出现图片溢出所在div或dialog等情况处理 用深度选择器修改v-html里面的内容样式即可。 <div class="dialog" v-html="content"></div> // css写法 <style> .dialog { width: 1024px; 阅读全文
posted @ 2021-03-29 11:46 bugSource 阅读(303) 评论(0) 推荐(0)
摘要:##主要记录一些曾经写过的有关el-ui样式修改的代码 修改 el-radio 激活颜色 .el-radio{ &.is-checked { .el-radio__inner{ background-color: #2CCF2A; border-color: #2CCF2A; } .el-radio 阅读全文
posted @ 2021-03-29 09:53 bugSource 阅读(1048) 评论(0) 推荐(0)
摘要:记录element组件el-form使用v-for和v-if时,验证数据时报错的处理。 v-for问题 使用v-for时导致表单验证出现this.$refs[formName].validate is not a function // $refs[formName]后面加多一个[0] this.$ 阅读全文
posted @ 2021-03-26 12:00 bugSource 阅读(379) 评论(0) 推荐(0)
摘要:初次学习vue时,由于经常需要下载各种组件库和框架进行摸索,所以经常要用到npm install指令,对过程中发生的一些报错也参考了不少人的文章,在这里整理一下笔记。 npm指向 npm config get registry 该指令是查看当前npm指向的下载仓库,默认是http://registr 阅读全文
posted @ 2021-03-26 11:38 bugSource 阅读(2006) 评论(0) 推荐(0)