上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
摘要: 组件: 可以编写react元素 虚拟DOM: react元素 真实的DOM: 可以展示 React里很重要的: 组件 组件目的: 复用 组件作用: 代码分隔 组件在React里有两种定义的方式: 第一种: 定义组件: 函数(JS函数) 函数组件:(不负责状态,只负责渲染) 功能组件 无状态组件 函数 阅读全文
posted @ 2022-11-17 14:53 Cherishe 阅读(36) 评论(0) 推荐(0)
摘要: 第一个加载的组件就是APP: <APP/> 当前咱们指定的DOM就是root: ReactDOM.createRoot(document.getElementById('root')); root在那个地方: react-app/public/index.html <div id="root"></ 阅读全文
posted @ 2022-11-17 13:41 Cherishe 阅读(21) 评论(0) 推荐(0)
摘要: node环境>=14.0.0 npm环境>=5.6 安装create-react-app:npm i -g create-react-app (cnpm/yarn) 创建项目:create-react-app react-project(项目名称) 进入项目根目录:cd react-project 阅读全文
posted @ 2022-11-17 12:43 Cherishe 阅读(79) 评论(0) 推荐(0)
摘要: 前提:实现了axios二次封装 // 注册api // 获取员工列表 export const sysUserSimple = () => { return request({ url: '/sys/user/simple' }) } // 导入api import { sysUserSimple 阅读全文
posted @ 2022-11-15 00:13 Cherishe 阅读(30) 评论(0) 推荐(0)
摘要: //表单element-ui // 表单 <el-form label-width="120px" :model="form" :rules="rules" ref="form"> <el-form-item prop="rulesprop" label="部门名称"> // 文本框 <el-inp 阅读全文
posted @ 2022-11-15 00:02 Cherishe 阅读(22) 评论(0) 推荐(0)
摘要: // 1、新增对话框 <el-dialog title="新增部门" width="700px" :visible.sync="show"> // 2、隐藏对话框 show: false // 3、导入注册使用新增对话框组件 // 使用 <!-- 新增弹框组件 --> <Add ref="add" 阅读全文
posted @ 2022-11-14 23:51 Cherishe 阅读(33) 评论(0) 推荐(0)
摘要: // 1、设置场景值 scene: '', // 2、标题上使用动态title :title="{ add: '新增题目', edit: '编辑题目' }[scene]" // 3、父级组件使用子级组件 <Add ref="add" /> // 4、编辑和新增按钮分别使用子级场景值 this.$re 阅读全文
posted @ 2022-11-14 23:40 Cherishe 阅读(33) 评论(0) 推荐(0)
摘要: 本地接口(启动) token失效(重新登录) 端口号占用(切换端口) 阅读全文
posted @ 2022-11-14 23:16 Cherishe 阅读(16) 评论(0) 推荐(0)
摘要: 点击查看代码 //安装: yarn add vue-i18n@6.x main.js import i18n from '@/lang' Vue.use(ElementUI, { i18n: (key, value) => i18n.t(key, value) }) src/lang/index.j 阅读全文
posted @ 2022-11-12 15:53 Cherishe 阅读(21) 评论(0) 推荐(0)
摘要: 什么时候在功能组件(ClassComponent)上使用类组件 (FunctionalComponent)?(必会) 点击查看代码 如果您的组件具有状态( state )或生命周期方法,请使用 Class 组件。否则,使用功能组件 阅读全文
posted @ 2022-11-12 15:01 Cherishe 阅读(39) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页