会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
病阳阳
孤独的大多数
博客园
首页
新随笔
联系
订阅
管理
2021年9月1日
Element ui Dialog 对话框 组件
摘要: 父组件: <template> <el-button type="primary" plain @click="Newlyadded('addOrder')">新增</el-button> <Add ref="addOrder" v-if="addOrderVisible" :visible.syn
阅读全文
posted @ 2021-09-01 17:51 病阳阳
阅读(252)
评论(0)
推荐(0)
2021年8月18日
获取当前时间 (年月日时分秒)
摘要: getNowTime() { var date = new Date(); year = date.getFullYear(); month = date.getMonth() + 1; var monthStr = month >= 10 ? month : "0" + month; day =
阅读全文
posted @ 2021-08-18 17:00 病阳阳
阅读(180)
评论(0)
推荐(0)
h5适配
摘要: var sizeFlag;if(document.documentElement.clientWidth >= 300 && document.documentElement.clientWidth <= 360) { sizeFlag = 7.50;} else if(document.docum
阅读全文
posted @ 2021-08-18 14:21 病阳阳
阅读(20)
评论(0)
推荐(0)
Vue打开新页面
摘要: seeShare(){ let routeUrl = this.$router.resolve({ path: "/share", query: {id:96} }); //let routeUrl = this.$router.resolve(`/share/${96}`) window.open
阅读全文
posted @ 2021-08-18 11:30 病阳阳
阅读(91)
评论(0)
推荐(0)
2020年12月21日
React中使用路由
摘要: 安装 npm i react-router-dom 在app.js或者index.js中使用 class App extends Component { render() { return ( <BrowserRouter> <Switch>{/*只访问一个*/} <Route exact path
阅读全文
posted @ 2020-12-21 17:13 病阳阳
阅读(63)
评论(0)
推荐(0)
2020年12月18日
NPM搭建React开发环境
摘要: 前提是安装了npm和node npm或cnpm命令创建项目: cnpm install -g create-react-app >>( npm install -g create-react-app ) create-react-app my-app (my-app是你自己的项目名称 自定义) 创建
阅读全文
posted @ 2020-12-18 11:07 病阳阳
阅读(194)
评论(0)
推荐(0)
2020年12月16日
列表 & key
摘要: 渲染多个组件 function NumberList(props) { const numbers = props.numbers; const listItems = numbers.map((number) => //不写key会看到警告 a key should be provided for
阅读全文
posted @ 2020-12-16 15:59 病阳阳
阅读(77)
评论(0)
推荐(0)
条件渲染
摘要: 逻辑与运算符 && true && expression : 返回expression false && expression :忽略并跳过 三元运算 condition ? true : false 阻止组件渲染 : 给props传入一个bool值 如果为假render方法返回null 而不进行任
阅读全文
posted @ 2020-12-16 14:49 病阳阳
阅读(59)
评论(0)
推荐(0)
2020年12月15日
事件处理
摘要: 传统HTML: <button onclick = "f1()"> Activate Lasers </button> React: <button onclick = {f1()}> Activate Lasers </button> 绑定this:==> onClick = {this.hand
阅读全文
posted @ 2020-12-15 17:56 病阳阳
阅读(85)
评论(0)
推荐(0)
State & 生命周期
摘要: 生命周期: mount(挂载) uunmount(卸载) componentDidMount() 组件渲染到DOM后运行 未完待续...
阅读全文
posted @ 2020-12-15 17:20 病阳阳
阅读(59)
评论(0)
推荐(0)
下一页
公告