
VUE
辛凡
这个作者很懒,什么都没留下…
展开
-
[Vue waError in callback for watcher “fileList“: “TypeError: Cannot create property ‘uid‘ on string
错误原因:类型错误,值不匹配this.imgLists 如下修改方法欢迎大神指导,初级vue原创 2021-04-02 09:47:02 · 2065 阅读 · 1 评论 -
echart报错 Cannot read property ‘getAttribute‘ of undefined
Error in created hook: "TypeError: Cannot read property 'getAttribute' of undefined"用的Vue,第一反应是echart的引用错误,然后用cdn的方式引入,也是这样的错,最后发现是生命周期的原因用的created调用方法官方说明:实例已经创建完成之后被调用。在这一步,实例已完成以下的配置:数据观测(data observer),属性和方法的运算, watch/event 事件回调。然而,挂载阶段还没开始,$el .原创 2020-11-19 13:27:30 · 12436 阅读 · 0 评论 -
element,JS设置时间戳为23:59:59,vue根据时间戳设置当前日期的时间为 23:59:59
var contractEndTime ; var date = new Date(this.contractEnd);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var dY = date.getFullYear() + '-'; var dM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() +...原创 2020-08-14 18:38:51 · 2764 阅读 · 0 评论 -
MUI分頁
<html> <head> <title></title> <link href="https://cdn.bootcss.com/mui/3.7.1/css/mui.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/jquery/1.11...原创 2020-07-31 08:22:33 · 316 阅读 · 0 评论 -
vue根据data的数据值动态设置switch状态禁用
vue根据data的数据值动态设置switch状态禁用 :disabled="accessLevel == 1" <el-switch v-model="list.newProduct" @change="changePro(list.id,list.newProduct,'')" inactive-text="新品...原创 2020-07-21 15:16:49 · 3912 阅读 · 0 评论 -
vue根据banner图颜色改变背景色
vue根据图片颜色改变背景色,UI框架vant利用v-bind属性给div设置style属性,利用vantchangeBanner(index){ this.bgColor = this.bannerList[index].color}v-bind:style="{background:'#'+bgColor}"<template> <div><!-- 搜索+导航 --> <div clas原创 2020-07-08 11:41:30 · 2152 阅读 · 3 评论 -
vue报错:Component template should contain exactly one root element
错误重现:错误原因:Component template should contain exactly one root element ----翻译为:如果你正在使用模板应该只包含一个根元素。解决办法:对模板template下只能使用一个元素,包一个大的div,其他元素都嵌套在这个div中...原创 2020-07-03 16:40:43 · 879 阅读 · 0 评论 -
VUE时间戳转换
VUE时间戳转换,src引入的方式1.通过vue过滤器---在创建 Vue 实例之前全局定义过滤器vue.filter index.html<div id="app"> <div>{{time | timeStamp}}</div></div><script src="../static/vue.js"></script><script src="../static/style.js">&l..原创 2020-07-31 08:21:57 · 548 阅读 · 0 评论 -
element报错 “t.getFullYear is not a function” ,TypeError:date.getHours is not a function
<el-date-picker v-model="setDate" type="date" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" placeholder="选择日期" > </el-date-picker> setDate:''总结:类型错误导致报错,date里面的值得类型不对,应该为字符串,而非其他类型 t.getFu...原创 2020-05-20 09:24:02 · 7903 阅读 · 0 评论 -
Error compiling template: <template> cannot be keyed. Place the key on real elements instead
<template v-for="item in quarterList" :key="item.id"> <td>{{item.quarterValue}}</td> </template>原因:vue不支持在 template 元素上绑定属性。比如这里想绑定 key 属性就不行。解...原创 2020-04-09 17:26:18 · 1263 阅读 · 0 评论 -
vue下拉选择select option多选取值问题
<el-select v-model="rolePost" multiple filterable allow-create default-first-option placeholder="请选择" @change="change"> <el-option v-for="item in rolePosts" :value="item.i...原创 2020-03-27 14:04:09 · 2487 阅读 · 0 评论 -
VUE防止闪烁
<style> [v-cloak]{ display: none; } </style><div id="app" v-cloak> 内容</div>原创 2020-02-25 22:04:55 · 610 阅读 · 0 评论 -
Vue切换导航菜单、标签切换,实现class切换
HTML <div class="text"> <input type="button" :class = "isActive == index?'btn-success':''" v-for="(item,index) in btnList" class="btn btn-rz mr-5 radius" @click="changeStatus...原创 2019-12-31 17:52:21 · 1038 阅读 · 1 评论 -
VUE图片显示,图片动态拼接host的方法
getBanner:function(){ const params = new URLSearchParams(); params.append('token', this.token); axios({ url:host+'Sys/findAllBanne...原创 2019-10-23 09:23:09 · 1157 阅读 · 0 评论 -
VUE+Element时间上传自定义方法
<el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList" list-type="picture" :http-request="upload" > <el-button size="sm...原创 2019-10-17 10:07:34 · 711 阅读 · 0 评论 -
Property or method “id” is not defined on the instance but referenced during render. Make sure that
报错详情[Vue warn]: Property or method “id” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based component...转载 2019-08-26 10:42:32 · 45570 阅读 · 3 评论