摘要: 查看源 npm config get registry 从指定的源下载安装包 npm install -g cnpm --registry=指定的源地址 阅读全文
posted @ 2024-01-11 15:03 上官兰雨 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 一:创建一个react项目 npx create-next-app my-app(项目名称)cd my-appnpm start 二:项目初始化 index.js import React from "react" import ReactDOM from "react-dom" import Ap 阅读全文
posted @ 2024-01-09 15:55 上官兰雨 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1)利用逻辑判断的短路运算来实现 && 和 ||(&& 中第一个表达式为假就不会去处理第二个表达式,|| 则相反) // if为真 if (bool) { value = getYes(); } // &&改版 bool && (value = getYes()); // if为假 if (!boo 阅读全文
posted @ 2023-10-14 22:26 上官兰雨 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 父组件中的一个变量和子组件的input框实现双向绑定,就要用到下面的方法: 父组件: <script> import CustomInput from './CustomInput.vue' export default { components: { CustomInput }, data() { 阅读全文
posted @ 2023-06-09 17:26 上官兰雨 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 如果你想要将一个对象的所有属性都当作 props 传入,你可以使用没有参数的 v-bind,即只使用 v-bind 而非 :prop-name。例如,这里有一个 post 对象: export default { data() { return { post: { id: 1, title: 'My 阅读全文
posted @ 2023-06-08 16:52 上官兰雨 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 需求: A页面有表单和表格,点击表格中的按钮到B页面,B页面操作完毕,再次回到A页面,表单元素保持不变,表格内容刷新。 通过管道通信去做,用两个管道嵌套,A页面跳转到B页面的时候,直接用管道发过去,B页面收不到信息,需要B页面先告诉A页面可以传值了,A页面再传值。B页面再接收A页面传过来的值,操作页 阅读全文
posted @ 2022-09-23 15:36 上官兰雨 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 一、什么是http HTTP 是一个在计算机世界里专门在两点之间传输文字、图片、音频、视频等超文本数据的约定和规范。 HTTP 是构建互联网的重要基础技术,它没有实体,依赖许多其他的技术来实现,但同时许多技术也都依赖于它。 在互联网世界里,HTTP 通常跑在 TCP/IP 协议栈之上,依靠 IP 协 阅读全文
posted @ 2022-03-13 11:37 上官兰雨 阅读(634) 评论(0) 推荐(0) 编辑
摘要: getLastDay(year, month) { let newYear = year, newMonth = month++; if (month > 12) { newMonth -= 12; newYear++; } let newDate = new Date(newYear, newMo 阅读全文
posted @ 2022-02-24 10:17 上官兰雨 阅读(7) 评论(0) 推荐(0) 编辑
摘要: toDemical(val) { let valNew = Math.round(parseFloat(val) * 100) / 100; let splitVal = valNew.toString().split("."); if (splitVal.length == 1) { valNew 阅读全文
posted @ 2022-02-24 09:51 上官兰雨 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 对象数组做排序 let arr = [{ name: "1990年版" }, { name: "1980年版" }, { name: "2002年版" }]; arr.sort((a, b) => { return b.name.localeCompare(a.name, undefined, { 阅读全文
posted @ 2022-01-12 16:34 上官兰雨 阅读(24) 评论(0) 推荐(0) 编辑