![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
mh_code
无名之辈
展开
-
关于el-table不能及时更新数据的问题
闲来无事写一写父子组件之间通讯的demo,遇到了好多坑,真的是菜。好,现在就记录下来。demo大概是上面的样子 点击新增个人信息 弹出子组件然后输入表单信息添加到父组件内,并可以在父组件上点击编辑按钮 弹出子组件回显要编辑的表单信息。遇到的最坑的地方就是el-table 不能及时回显数据(但是数据已经更新)。1.父组件控制子组件的显示<add-list :title="title" :dialogVisible.sync="isShowInfo...原创 2021-07-13 17:09:51 · 3984 阅读 · 2 评论 -
2021-03-27
1.如果一个 变量根本没有被声明,使用typeof反而不会报错。typeof undeclared_variable //"undefined"2.在没有let之前,typeof是一个百分百安全的运算符,永远不会报错。3.在代码块内,使用let命令声明了一个变量,在声明之前该变量都是不可用的,这在语法上称为“暂时性死区”。...原创 2021-03-27 08:02:07 · 57 阅读 · 0 评论 -
2021-03-15
我们前端在对后台接口的时候,往往会发现接口中的某个字段没有数据,回显的事null 或者 '' 再或者是 undefined,比如我们获取后台借口头像的地址imgURl ,var imgURL;if(imgURL!=null && typeof(imgURL)!= undefined&&imgURL !=''){ //imgURL有内容才执行的代码 }此时我们就可以换另外一种写法,if (!!imgURL) { //imgURL 有内容才执行的代原创 2021-03-15 21:53:40 · 57 阅读 · 0 评论 -
vue 点击添加class,其他元素移除class(循环数组)
<div class="admin-main-nav"> <ul id="mainNav"> <li v-for="(item, index) in items" :key="item.id" :class="{ active: current == index }" @click="selectNav(index)" > &l.原创 2020-05-28 17:44:17 · 1797 阅读 · 1 评论 -
小程序金额显示隐藏
要求上面的金额显示隐藏。wxml:<view class="month-spendingBox"> <view class="month-spendingInwrap" bindtap="eyeChange"> <text>本月支出 (元)</text> <view class="spending-...原创 2020-04-07 16:02:52 · 821 阅读 · 0 评论 -
小程序点击按钮显示隐藏
wxml:<view > <button class="{{showView?'show':'hide'}}" bindtap="change">{{showView?'隐藏':'显示'}}</button> <button class="{{showView?'hide':'show'}}" bindtap="change">...原创 2020-04-07 15:05:50 · 5286 阅读 · 1 评论 -
关于swiper滑动时a标签误触,导致跳转的解决办法。(简单粗暴)
var swiper = new Swiper('.swiper-container', { on: { touchStart: function(event){ event.stopPropagation() }, }, });原创 2019-05-30 14:17:34 · 1170 阅读 · 0 评论 -
jquery.scrollbar模拟滚动条的使用
1.需要引入的文件<link rel="stylesheet" href="../css/jquery.scrollbar.css" /><script src="../js/jquery-1.7.2.min.js"></script><script src="../js/jquery.scrollbar.min.js"&原创 2018-08-23 16:52:55 · 2768 阅读 · 0 评论