
vue
触不到的颜色是否叫彩虹
这个作者很懒,什么都没留下…
展开
-
vue 自定义全屏组件
1. FullScreen.vue<template> <span class="full_screen" @click="toggleFullScreen"></span></template><script>import { mapActions, mapMutations, mapState } from 'vuex'export default { name: 'FullScreen', data(){ return原创 2022-04-22 15:54:38 · 1281 阅读 · 1 评论 -
Vuecli3按需引入elementUi
1. elementConfig.jsimport { Carousel, CarouselItem, Dropdown, DropdownMenu, DropdownItem, Dialog, Button, Form, FormItem, Input, Table, TableColumn, Image, Upload, Select, Option} from 'element-ui'export default { install (V) { V.use(Carousel)原创 2022-04-20 17:30:53 · 1196 阅读 · 0 评论 -
Vuecli3配置postcss-pxtorem
安装npm install postcss-pxtorem@5.1.1 --save-devpostcss-pxtorem版本6.0.0因为版本太高导致报错配置: 修改package.json "postcss": { "plugins": { "autoprefixer": {}, "postcss-pxtorem": { "rootValue": 18, "minPixelValue": 2, "prop.转载 2022-04-20 17:00:51 · 1239 阅读 · 0 评论 -
el-dialog中表单校验问题:第二次打开时会触发校验
当required属性为变量时,rules规则应写在el-form-item项上,如果写在el-form上,则第二次打开dialog时会触发校验并且显示校验结果。eg:假设有单选项type,枚举值为1,2。另有一项user,type值为1时必填,type值为2时非必填。未完待续...原创 2021-11-25 17:50:27 · 2657 阅读 · 4 评论 -
多个路由共用一个页面,路由间切换时页面刷新问题
路由/userAudit和/userManage共用了同一个view,table有selection, a, b, c, 操作五个列,/userManage显示a, c, 操作三列;/userAudit显示selection, a, b三列。当路由在/userAudit和/userManage间切换的时候,列表显示出现问题,<el-table v-if="renderTable"></el-table>data() { return { renderTable: true原创 2021-10-26 16:33:18 · 858 阅读 · 2 评论 -
vue获取并显示服务器时间
由于http响应头会带有服务器时间,所以就在响应拦截器中获取了服务器时间import store from '@/store'service.interceptors.response.use((response) => { if(response.headers['date']) { store.commit('common/setServiceTime', response.headers.date) }})common stroeconst state = { differ原创 2021-10-15 11:53:30 · 3539 阅读 · 0 评论 -
vue-cli3路由懒加载不生效
按照推荐将vue的路由配置如下来实现懒加载,但是路由懒加载不生效,还是会把所有的chunk加载出来:{ //首页 path: '/index', name: 'index', component: () => import(/* webpackChunkName: "home" */ '@/views/index/index.vue'),},{ //列表 path: '/list', name: 'list', component: ()转载 2021-09-10 15:33:10 · 1745 阅读 · 0 评论 -
vue-quill-editor富文本--图片上传服务器
组件代码<template> <div> <quill-editor v-model="content" ref="quill" :options="editorOption" class="editor"> </quill-editor> <input type="file" @change="onEditorChange" id="upload" style="display:none;" /> </div>&l原创 2021-08-04 16:47:57 · 206 阅读 · 0 评论 -
vue2.x集成 swiper轮播图
1、安装 vue-awesome-swipernpm install vue-awesome-swiper swiper@5.x --save2、使用 vue-awesome-swiper<template> <swiper class="swiper" :options="swiperOption" ref="mySwiper"> <!-- slides --> <swiper-slide>I'm Slide 1</swiper-sl原创 2021-07-23 18:45:14 · 148 阅读 · 0 评论 -
vue 动态绑定背景图片
动态设置背景图<template> <div class="wrap" :style="bacImage"> <img :src="iconUrl" alt=""> <div class="weather-info"> <span class="temperature">31℃</span> <span class="weather">{{weatherInfo.weather}}</span&原创 2021-07-22 17:30:02 · 408 阅读 · 0 评论 -
vue PC端实现选择图片或摄像头拍照
添加用户的时候需要选择本地照片或拍照采集用户头像:子组件<template> <div class="image-capture"> <div class="camera_outer"> <div id="placeholder" class="placeholder" v-show="!showVideo"> </div> <video id="videoCamera" :width="vide原创 2020-11-05 15:51:18 · 588 阅读 · 0 评论 -
el-menu动态菜单递归组件
前几天看别人文章写得,那时候没空没写博客。这时候再找却找不到原文了,大家有看到原文的话请留言告知,不胜感激。1、子组件export default { name: 'Nav', functional: true, render(h, { props }) { return props.menus.map((menu) => { if(!!menu.childs && menu.childs.length > 0){ return h('el-subme转载 2020-09-22 16:15:06 · 475 阅读 · 0 评论