- 博客(9)
- 资源 (2)
- 收藏
- 关注
原创 使用vue-cli快速创建vue3项目
条件:npm 更至最新node >=8.91.全局安装 npm install -g @vue/cli 或 yarn global add @vue/cli2.查看版本/是否安装成功 vue -V (V要大写)3.然后在文件夹下面cmd 输入 vue create my-peojectDefault ([Vue 2] babel, eslint) //创建默认vue2Default (Vue 3 Preview, ([Vue 3] babel, eslint))
2021-12-08 15:28:02
226
原创 提高代码可读性的JvacaScript小技巧
1.检查对象是否为空const isEmpty = obj => Reflect.ownKeys(obj).length === 0 && obj.constructor === Objectconsole.log(isEmpty({})) //trueconsole.log(isEmpty({name:'张三'})) //false2.获取两个日期之间的天差const daysBetween = (date1, date2) => Math.ceil(Mat
2021-12-08 15:01:04
345
原创 vue封装axios请求
1.新建request.js文件,然后写入import axios from 'axios'import {MessageBox,Message} from 'element-ui'import qs from 'qs'import router from '@/router'import {uuid} from '@/utils'import {getAccessToken} from '@/utils/accessToken'const service = axios.create({
2021-07-12 17:08:34
140
原创 vue中在methods中使用filters里的方法
vue中在methods中使用filter里的方法一般我们是在同一页面设置filters方法filterName(val){ //里面写逻辑}然后想在methods中使用filters的方法this.$options.filters['filterName'] (val)
2021-06-07 09:27:57
1306
原创 uniapp微信小程序uni-load-more上拉加载更多数据
1.引入uni-app中uni-load-more.vue到自己的项目import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';2.data 中定义reload: false,status: 'more',contentText: { contentdown: '上拉加载更多~', contentrefresh: '加载中', contentnomore: '我是有底线的~'},3.在需要加载的
2021-01-05 16:10:43
5337
1
原创 vue中使用videojs播放rtmp流视频
首先npm安装videojsnpm install video.js --save然后页面引入video.js相关内容 import videojs from "video.js"; import "video.js/dist/video-js.css";页面html代码<video id="my-player" class="video-js vjs-default-skin" preload="auto" data-setup="{&
2020-09-14 11:00:59
4232
原创 vue+element tree组件 回显数据时有一个父节点数据下面子节点都会被选中
当el-tree 从后台拿到数据动态展示出来时,会出现一个父节点下面的所有子节点全部被勾选了解决方法代码如下:<el-tree :data="data" show-checkbox node-key="id" ref="tree" :check-strictly="isCheck" :expand-on-click-node="false" :props="defaultProps"></el-tree>1.先设置check-strictly 是一个变量is
2020-05-08 18:11:13
3369
3
原创 vue+element Upload上传
页面代码<el-upload action="" list-type="picture-card" :limit="1" name="image" :multiple="false" :on-preview="handlePictureCardPreview" :on-success="handleAvatarSuccess" :on-remove="handleRemov...
2020-04-21 13:42:37
546
原创 vue+element 使用scoped-slot自定义数据项自定义Transfer 穿梭框数据
页面代码`<div style="text-align:center;"> <el-transfer class="trans" v-model="value" filterable :titles="['待选列表', '已选列表']" :button-texts="['到左边', '到右边']" :props="{ ...
2020-04-21 10:15:28
3140
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人