会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
strundent
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
···
13
下一页
2022年11月21日
局部按照vue-cli,实现版本切换
摘要: 文件说明 npm init -y #初始化项目依赖文件 cnpm i -D @vue/cli #安装脚手架 npx vue -V #查看vue-cli版本号 npx vue create project-one #创建项目 #or npx v 项目启动 yarn serve 项目配置 vue.con
阅读全文
posted @ 2022-11-21 00:28 Cherishe
阅读(269)
评论(0)
推荐(0)
2022年11月20日
谈谈你对react的理解
摘要: React组件设计相关的问题时: 有经验的求职者就会想到函数组件,类组件以及纯组件 高阶组件和渲染劫持相关内容?... 横向比较,纵向延伸 正确的方式比学习本身更重要,也使得学习更高效 纵向深挖问题,基于树状结构去掌握知识点的底层原理 React: 组件基础 状态管理 渲染流程 性能优化 React
阅读全文
posted @ 2022-11-20 21:44 Cherishe
阅读(105)
评论(0)
推荐(0)
2022年11月18日
react项目搭建
摘要: npx create-react-app my-app cd my-app npm start 添加路由库 react-router-dom npm i react-router-dom package.js name:项目名称 version:项目版号 private:项目是否开源 depende
阅读全文
posted @ 2022-11-18 17:28 Cherishe
阅读(24)
评论(0)
推荐(0)
React-useEffect轮播
摘要: 第零步:导入 import React,{useState,useEffect} from "react" 第一步: 创建函数组件: export default function Banner(){ 第二步: 改变状态: const [n,setN] = useState(0)//改变数值 con
阅读全文
posted @ 2022-11-18 16:55 Cherishe
阅读(65)
评论(0)
推荐(0)
轮播组件基本结构(类组件)
摘要: // 导入 import React,{} from "react" //使用:基本结构 export default class Banner extends React.Component{ //状态: constructor(){ super(); this.state={ //写数据 } }
阅读全文
posted @ 2022-11-18 13:44 Cherishe
阅读(54)
评论(0)
推荐(1)
Effect Hook
摘要: Effect Hook: 函数组件执行副作用操作 函数组件+hook import React,{useEffect,useState} from "react" export default function Hook(){ //状态:(声明) const [count,setCount] = u
阅读全文
posted @ 2022-11-18 12:43 Cherishe
阅读(18)
评论(0)
推荐(0)
Hook
摘要: hook: 特殊的函数 hook作用: 钩入react的特性 useState: 函数组件添加state的hook hook的声明: 类组件: default export class Hook extends react.Component{ //在这里写状态: constructor(){ su
阅读全文
posted @ 2022-11-18 12:16 Cherishe
阅读(117)
评论(0)
推荐(0)
2022年11月17日
Hook代替类组件(hook+函数组件)
摘要: Hook是React 16.8的新增特性,它可以在不编写类组件的情况下使用state以及其他React特性 Hook和函数组件: React的函数组件处理是这样的 const Demo = (props)=>{ // 可以在这使用 Hook ... return <div>Hook</div> }
阅读全文
posted @ 2022-11-17 21:48 Cherishe
阅读(120)
评论(0)
推荐(0)
React-router
摘要: 使用React构建单页面应用,要想实现页面间的跳转,首先想到的就是使用路由 下载: npm install react-router-dom //或者 yarn add react-router-dom 路由组件: BrowserRouter BrowserRouter: 为一个容器,用来放Rout
阅读全文
posted @ 2022-11-17 20:13 Cherishe
阅读(33)
评论(0)
推荐(0)
类组件的使用
摘要: export default class App extends Component{ // 状态: constructor(){ super()//父级构造函数调用 this.state={ title:'zhaoxing', id:'1' } } // 渲染: render(){ return
阅读全文
posted @ 2022-11-17 19:21 Cherishe
阅读(23)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
13
下一页
公告