会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
IT小姐姐
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
14
下一页
2023年12月8日
vue中this.$refs的使用方法和遇到的问题
摘要: this.$refs :用于操作真实的DOM节点。 在开发时碰到了一个小需求,需要子组件向父组件传参,而且是不需要通过事件传递的,一开始使用this.$emit()来写的,但是一直没有接受到参数,于是放弃了使用this.$emit()的使用。 于是,使用了在父组件中调用子组件的方法,来获取传递的参数
阅读全文
posted @ 2023-12-08 10:50 IT小姐姐
阅读(6462)
评论(0)
推荐(0)
2023年12月7日
vue中this.$set()的使用
摘要: data中数据,都是响应式。也就是说,如果操作data中的数据,视图会实时更新; 但在实际开发中,遇到过一个坑:若data中数据类型较为复杂,方法methods中改变对象的属性,而页面并不会改变 原因是vue监听不到数据类型特别复杂的属性。 可以使用this.$set()来进行强制更新,进而解决问题
阅读全文
posted @ 2023-12-07 14:04 IT小姐姐
阅读(1866)
评论(0)
推荐(0)
2023年9月11日
css3属性之 text-overflow:ellipsis
摘要: 语法: text-overflow:clip | ellipsis 默认值为clip 不显示省略标记 clip:当前对象内文本溢出时不显示省略标记,而是将溢出部分裁剪。 ellipsis:当对象内文本一处时显示省略标记(...)。 一、常见的单行文本溢出显示省略写法: text-overflow:
阅读全文
posted @ 2023-09-11 17:22 IT小姐姐
阅读(111)
评论(0)
推荐(0)
css防止图片挤压变形 object-fit: cover
摘要: img{ width:200px; height:100px; object-fit: cover; } 该属性会对图片保留原始比列,多余的会被裁剪。 添加该属性会适应指定容器的高度与宽度。 一般用于 img 和 video 标签,一般可以对这些元素进行保留原始比例的剪切、缩放或者直接进行拉伸等 语
阅读全文
posted @ 2023-09-11 10:17 IT小姐姐
阅读(644)
评论(0)
推荐(0)
2023年9月7日
css实现 h5滑动时隐藏滚动条
摘要: .menus{ margin: 10px 0 ; margin-left: 18px; display: flex; flex-wrap: nowrap; overflow-x: auto; } .menus::-webkit-scrollbar { display: none; width: 0
阅读全文
posted @ 2023-09-07 19:11 IT小姐姐
阅读(461)
评论(0)
推荐(0)
react hooks 防止重复点击事件
摘要: 一、使用useRef控制 import React ,{useState, useRef} from 'react' import './App.css'; function App() { const [count ,setCount] = useState(0) const flag = use
阅读全文
posted @ 2023-09-07 15:45 IT小姐姐
阅读(589)
评论(0)
推荐(0)
react hooks 中useContext的使用
摘要: 父组件中: import React ,{useState, createContext} from 'react' import './App.css'; import ChildOne from './components/ChildOne'; import ChildTwo from './c
阅读全文
posted @ 2023-09-07 14:16 IT小姐姐
阅读(39)
评论(0)
推荐(0)
2023年8月27日
git 合并分支代码到 master
摘要: git checkout master git pull origin master git merge dev git status git push origin master
阅读全文
posted @ 2023-08-27 19:55 IT小姐姐
阅读(37)
评论(0)
推荐(0)
react hooks中使用promise.all
摘要: useEffect(async () => { const getFirstResponse = async () => { try { return await axios.get('http://first-api', { params: { carId: id }, }); } catch (
阅读全文
posted @ 2023-08-27 13:19 IT小姐姐
阅读(228)
评论(0)
推荐(0)
2023年8月20日
react hooks 父传子,子传父
摘要: 一、子传父 父组件中: import React,{useState } from "react"; import HeXiaoDialog from "../components/hexiaoDialog"; //引入的子组件 function ShuoMing(props){ let [flag
阅读全文
posted @ 2023-08-20 21:10 IT小姐姐
阅读(489)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
14
下一页
公告