会员
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Nyan
博客园
首页
新随笔
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
52
下一页
2021年2月27日
git: 替换remote origin
摘要: 查看远程origin地址: git remote -v 删除现有的origin地址 或 更新名称: git remote remove origingit remote rename origin 新名称 添加新的origin地址(新建的代码托管地址): git remote add origin
阅读全文
posted @ 2021-02-27 09:32 Nyan
阅读(5618)
评论(0)
推荐(0)
2021年2月26日
taro3.x: h5地图兼容组件封装
摘要: taro Map组件不兼容H5 地图父组件: import React, { useEffect, useMemo, useRef, useState } from 'react' import Taro, { getCurrentInstance, useReady } from '@tarojs
阅读全文
posted @ 2021-02-26 11:30 Nyan
阅读(758)
评论(0)
推荐(1)
2021年2月25日
taro3.x: h5地图兼容
摘要: 首先在index.html文件引入: <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=kM1RFA6AzOnv6lmlc7qyOMhqBILu1pgk"></script> 简单实现地图显示: useReady
阅读全文
posted @ 2021-02-25 15:57 Nyan
阅读(310)
评论(0)
推荐(0)
taro3.x: 使用taro-router在H5浏览器返回报错
摘要: h5使用useRouter导致返回报错TypeError: Cannot read property 'options' of undefined at onUnload 使用taro的getCurrentInstance().router获取参数 / 目标页面获取数据,Class组件: const
阅读全文
posted @ 2021-02-25 11:07 Nyan
阅读(713)
评论(0)
推荐(0)
2021年2月23日
taro3.x: tarojs-router
摘要: npm install tarojs-router 简单实现: github: https://github.com/lblblong/tarojs-router 创建router配置目录src/router src/router/middleware/author-check.ts import
阅读全文
posted @ 2021-02-23 09:33 Nyan
阅读(847)
评论(0)
推荐(0)
2021年2月22日
taro3.x: h5-MovableView兼容解决
摘要: MovableView不支持h5,使用onTouchMove实现拖拽 main.tsx import React, { useEffect, useState } from 'react' import Taro from '@tarojs/taro' import { View, Image, T
阅读全文
posted @ 2021-02-22 16:16 Nyan
阅读(744)
评论(0)
推荐(0)
2021年2月18日
create-react-app:“proxy” in package.json must be a string 解决办法
摘要: 方法1:那就按照字符串来配置 方法2:http-proxy-middleware 插件。 npm install http-proxy-middleware --save 然后在src目录下创建一个setupProxy.js文件。内容如下: const { createProxyMiddleware
阅读全文
posted @ 2021-02-18 09:42 Nyan
阅读(165)
评论(0)
推荐(0)
2021年2月8日
react: create-react-app配置port和host以及sourcemap关闭
摘要: 在项目根目录新建.env文件(环境变量) //关闭source map GENERATE_SOURCEMAP=false //关闭自动打开浏览器 //BROWSER=none //本地host HOST=m.loubei.com //本地端口 PORT=80 本地hosts文件添加 127.0.0.
阅读全文
posted @ 2021-02-08 14:47 Nyan
阅读(557)
评论(0)
推荐(0)
reate-react-app: webpack typescrpt alias
摘要: tsconfig.json添加: "baseUrl": ".", "paths": { "@/*": ["src/*"], "@assets/*": ["src/assets/*"], // css, html中需要 `~@assets/*` } config/webpack.config.js f
阅读全文
posted @ 2021-02-08 10:37 Nyan
阅读(83)
评论(0)
推荐(0)
2021年2月5日
react:处理图片类似小程序mode: aspectFill
摘要: 调整图片组件封装: import './index.scss' const ZoomImage = (props) => { const imageStyle = { backgroundImage: `url(${props.url})` } return ( <> <div className=
阅读全文
posted @ 2021-02-05 16:06 Nyan
阅读(202)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
52
下一页
公告