上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: this.$refs :用于操作真实的DOM节点。 在开发时碰到了一个小需求,需要子组件向父组件传参,而且是不需要通过事件传递的,一开始使用this.$emit()来写的,但是一直没有接受到参数,于是放弃了使用this.$emit()的使用。 于是,使用了在父组件中调用子组件的方法,来获取传递的参数 阅读全文
posted @ 2023-12-08 10:50 IT小姐姐 阅读(1715) 评论(0) 推荐(0) 编辑
摘要: data中数据,都是响应式。也就是说,如果操作data中的数据,视图会实时更新; 但在实际开发中,遇到过一个坑:若data中数据类型较为复杂,方法methods中改变对象的属性,而页面并不会改变 原因是vue监听不到数据类型特别复杂的属性。 可以使用this.$set()来进行强制更新,进而解决问题 阅读全文
posted @ 2023-12-07 14:04 IT小姐姐 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 语法: text-overflow:clip | ellipsis 默认值为clip 不显示省略标记 clip:当前对象内文本溢出时不显示省略标记,而是将溢出部分裁剪。 ellipsis:当对象内文本一处时显示省略标记(...)。 一、常见的单行文本溢出显示省略写法: text-overflow: 阅读全文
posted @ 2023-09-11 17:22 IT小姐姐 阅读(24) 评论(0) 推荐(0) 编辑
摘要: img{ width:200px; height:100px; object-fit: cover; } 该属性会对图片保留原始比列,多余的会被裁剪。 添加该属性会适应指定容器的高度与宽度。 一般用于 img 和 video 标签,一般可以对这些元素进行保留原始比例的剪切、缩放或者直接进行拉伸等 语 阅读全文
posted @ 2023-09-11 10:18 IT小姐姐 阅读(276) 评论(0) 推荐(0) 编辑
摘要: .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小姐姐 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 一、使用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小姐姐 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 父组件中: 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小姐姐 阅读(18) 评论(0) 推荐(0) 编辑
摘要: git checkout master git pull origin master git merge dev git status git push origin master 阅读全文
posted @ 2023-08-27 19:55 IT小姐姐 阅读(24) 评论(0) 推荐(0) 编辑
摘要: useEffect(async () => { const getFirstResponse = async () => { try { return await axios.get('http://first-api', { params: { carId: id }, }); } catch ( 阅读全文
posted @ 2023-08-27 13:19 IT小姐姐 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 一、子传父 父组件中: import React,{useState } from "react"; import HeXiaoDialog from "../components/hexiaoDialog"; //引入的子组件 function ShuoMing(props){ let [flag 阅读全文
posted @ 2023-08-20 21:10 IT小姐姐 阅读(202) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页