- 博客(190)
- 收藏
- 关注

转载 VUE前端cookie操作
如下是简单cookie操作,当前仅限前端实例要注意的有两点:1、cookie内容存贮的名称2、删除cookie是通过设置过期为过去时间实现的<body><div id="app"> <button @click="clearCookie()"> 清除cookie </button></div&...
2019-05-30 14:21:50
1315

转载 C语言:定义字符串的几种方式
#include <stdio.h>#include <stdlib.h>int main(){ //定义字符串的几种方式 //字符串和字符数组的区别:最后一位是否是空字符 char names1[] = {'j', 'a', 'c', 'k', '\0'}; char names2[50] = "jack"; char * ...
2019-05-30 14:14:26
79174
2

原创 Build input file cannot be found: '../node_modules/react-native/Libraries/WebSocket/libfishhook.a'
2018-10-24 11:03:10
6838

原创 vue Error: Request failed with status code vue-cli 配置 proxyTable pathRewrite
vue-config-index.js中,proxyTable中的pathRewrite有什么用呢? 首先,在ProxyTable模块中设置了‘/api’,target中设置服务器地址,也就是接口的开头那段地址,例如‘172.0.0.1’,然后我们在调用接口的时候,就可以全局使用‘/api’,这时候‘/api’的作用就相当于‘172.0.0.1’,比如接口的地址是‘172.0.0.1/us...
2018-08-20 16:28:07
11777

原创 git push failed to push some refs to xxxx 失败与解决方法
今天想把最近的一些小代码push到github上我先是将该目录git init进行初始化,然后git add -A ,接着git commit -m “description...”然后在github上新建一个远程库,想要将其与我本地的库相关联,使用:git remote add origin git@github.com:YOURGITHUBNAME/REPOS...
2018-08-17 18:17:37
10417
2

转载 linux ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
一般这个错误是由密码错误引起,解决的办法自然就是重置密码。假设我们使用的是root账户。1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下:#vim /etc/my.cnf(注:windows下修改的是my.ini)在文档内搜索mysqld定位到[mysqld]文本段:/mysqld(在vim编辑状态下直接输入该命令可搜索文本内容)在[mysqld]后面任意一行添...
2018-08-07 15:41:29
21047
4

原创 Redux API 和 Redux 源码结构
Redux APIexport { createStore, //创建一个state用来存储状态树 combineReducers, //合并reducer bindActionCreators, //将dispatch和action结合 applyMiddleware, //调度中间件来增强store,例如中间件redux-t
2018-01-08 17:14:41
312

原创 箭头函数esLint的语法检测Unexpected block statement surrounding arrow body
如果箭头函数的代码块部分多于一条语句,就要使用大括号将它们括起来,并且使用return语句返回。var sum = (num1, num2) => { return num1 + num2; } //此时eslint语法检测会报错需要写成:var sum = (num1, num2) => num1 + num2 //默认返回值由于大括号被解释为代码块,所以如果
2017-12-29 17:01:45
32876

原创 react-native获取组件的位置高度宽
measure函数可以获取当前的位置、宽、高信息;this.refs.name.measure( fn () )fn(fx, fy, width, height, px, py){console.log(....)}
2017-12-27 18:06:11
6029
原创 js 数组对象筛选出相同的数据并合并
const arr1 ={name: “001”,img: require("./images/silver_outstanding_01.png"),}]const arr2 = const arr1 ={medalName: “001”,time: “2022”,}]arrAdd(arr1, arr2) {let arr = [];arr2.filter(item => arr1.some(ele=> {if(ele.name === item.medalNam
2022-03-29 14:28:01
1835
原创 JS身份证号码校验大全史上最全号称公安局安全监测
身份证号码校验function testid(id) { // 1 "验证通过!", 0 //校验不通过 // id为身份证号码 var format = /^(([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4}(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9
2021-03-24 17:32:04
988
原创 js 去掉数组对象中的重复对象
在数组对象中去掉重复的对象:export function deteleObject(obj) { var uniques = []; var stringify = {}; for (var i = 0; i < obj.length; i++) { var keys = Object.keys(obj[i]); keys.sort(function(a, b) { return (Number(a) - Number(b)); }); var str = ''; for (var j =.
2020-12-09 03:22:56
1357
1
原创 关于配置Associated Domains Capability遇到的问题
一、前提条件:1、已在开发者平台配置好Associated Domains Capability;2、已在Xcode添加Associated Domains Capability;3、开发者账号没问题;4、Automatically manage signing;二、项目编译运行后,报如下错误:Your account does not have sufficient permissions to modify containers.Provisioning profile “iOS Te
2020-10-27 15:26:06
3574
转载 vue表格实现固定表头和首列
前言 前段时间做移动端的项目,项目中需要一个固定表头和首列的表格,但由于是移动端的,组件库里没有类似的,于是,就去网上找看有没有类似的,结果越找越气,10个文章9个抄,抄也行,你倒是抄个能用的啊,一篇根本就不能用的文章,抄个什么劲?有意义??? 没办法,只有自己写一个了。 效果图...
2020-09-10 11:30:53
4905
3
原创 vue使用vconsole调试log日志
首先使用命令在项目中下载vconsole1. npm install vconsole 2 然后在main.js中加入以下代码(或者在需要的页面添加):import Vconsole from 'vconsole'let vConsole = new Vconsole()Vue.use(vConsole)
2020-08-17 17:59:57
2305
原创 Library not found for -lstdc++.6.0.9
下载这个脚本,这个脚本能一键配置:https://github.com/devdawei/libstdc-具体使用方法:Xcode 10和Xcode 11中删除的libstdc++库先下载下来这个项目,然后把该文件拖到桌面,然后打开终端cd到刚下载的这个文件夹:libstdc--master文件夹;如果你使用的是 Xcode 10,则打开刚下载的这个文件夹,在里面找到:install-Xcode_10.sh,这个文件,在将install-Xcode_10.sh拖到终端中执行即可。Xcode 11 b
2020-07-06 14:28:54
255
原创 React Native — Unknown argument type ‘attribute’ in method -[RCTAppState getCurrentAppState:error:].
React/Base/RCTModuleMethod.mm91行static BOOL RCTParseUnused(const char **input) { return RCTReadString(input, "__attribute__((unused))") || RCTReadString(input, "__attribute__((__unused__))") || // 添加此行 ...
2020-07-02 15:51:47
439
原创 Xcode 11报错 library not found for -libstdc++.6.0.9
1.真机将libstdc++.6.0.9.tbd文件拷贝到以下路径:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib2.模拟器将libstdc++.6.0.9.tbd文件拷贝到以下路径:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimula..
2020-07-02 15:32:35
597
原创 Nginx基本操作
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmsudo yum install -y nginx查看Nginx是否启动ps -ef | grep nginx
2020-06-28 17:43:03
130
转载 vue-router 2.0 常用基础知识点之router.push()
router.push(location)http://www.jianshu.com/p/ee7ff3d1d93d除了使用 <router-link> 创建 a 标签来定义导航链接,我们还可以借助 router 的实例方法,通过编写代码来实现。router.push(location)想要导航到不同的 URL,则使用 router.push 方法。这个方法会向 history 栈添加一个新的记录,...
2020-06-28 17:33:00
237
转载 VUE理解 $nextTick 的作用
有同学在看 Vue 官方文档时,对 API 文档中的 Vue.nextTick 和 vm.$nextTick 的作用不太理解。其实如果看一下深入响应式原理 - vue.js中的有关内容,可能会有所理解,不过有些同学可能看到这个标题之后就选择跳过了,因此这里简述如下:Vue 实现响应式并不是数据发生变化之后 DOM 立即变化,而是按一定的策略进行 DOM 的更新。$nextTick 是在下次 DOM 更新循环结...
2020-06-28 17:31:49
348
原创 react-native-image-crop-picke
No known class method for selector 'labelColor'QBImagePicker/QBAssetsViewController.m:198:31: error: no known class method for selector 'labelColor''RCTImageURLLoader.h' file not found解决方案: #ifdef __IPHONE_13_0 if (@available(iOS 13.0, *)) .
2020-06-28 17:22:37
495
原创 react-native升级问题总结
问题1: react-native-collapsible---->undefined is not an object evaluating reactNative.View.propTypes解决方案 升级 react-native-collapsible问题2:antd-mobile-rn undefined is not an object (evaluating' react.PropTypes.bool')解决方案 npm install @ant-design/reac...
2020-06-28 17:18:04
1698
原创 React/RCTRootContentView.h file not found Cannot read property Direction of undefined
'React/RCTRootContentView.h' file not found Cannot read property 'Direction' of undefined Got the same error using 1.5.0 on RN 0.59.9To temporarily downgrade put this in your package.json:"react-native-gesture-handler": "~1.4.0",And reinstall y...
2020-06-28 17:05:04
1444
原创 TypeError: Cannot read property contain of undefined
Unhandled JS Exception: TypeError: TypeError: Cannot read property 'contain' of undefinedRN版本升级 : resizeMode={Image.resizeMode.center} 改成 resizeMode={'center'}
2020-06-28 17:03:01
987
原创 We ran xcodebuild command but it exited with error code 65
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening .xcworkspace解决方案:重新build clean
2020-06-28 17:00:23
2083
原创 Error: Unable to resolve module `../../image/Home/@2x.png`
error: bundling failed: Error: Unable to resolve module `../../image/Task/xxx@2x.png` from `/Users/xxxx/TaskDetails.js`: The module `../../image/Task/weixin@2x.png` could not be found from `/Users/xxx.js`. Indeed, none of these files exist:* `weixin@2x.pn
2020-06-28 16:58:15
1216
原创 react-native-swiper 轮播最后一张图跑到第一章
componentDidUpdate() { const scrollView = this.scrollView scrollView.scrollBy(0, false) }<Swiper ref={(e) => { this.scrollView = e }} //加上这句 防止最后一张跑到第一张 shows...
2020-04-23 22:43:27
1063
原创 react-native code-push热更新手动link-ios
安装 CodePush CLI管理 CodePush 账号需要通过 NodeJS-based CLI。只需要在终端输入 npm install -g code-push-cli,就可以安装了。安装完毕后,输入 code-push -v查看版本,如看到版本代表成功。PS.npm为NodeJS的包管理器,如果你没安装NodeJS请先安装。创建一个CodePush 账号在终端输入code-...
2020-03-20 17:36:03
318
原创 git submodule: already exists in the index
在 github 上面 clone 一个包含有 submodule 的 repo 的时候,用如下命令更新 submodule:git submodule update --remote --merge一直没法更新,尝试重新 add submodule,比如:git submodule add https://github.com/cisco/openh264 open_source_cod...
2019-12-12 16:15:41
10611
1
原创 JavaScript 复杂判断的更优雅写法
先看一段代码/** * 按钮点击事件 * @param {number} status 活动状态:1 开团进行中 2 开团失败 3 商品售罄 4 开团成功 5 系统取消 */const onButtonClick = (status)=>{ if(status == 1){ sendLog('processing') ...
2019-12-12 16:13:42
191
原创 js 创建二维数组方法定义
方法一:直接定义并且初始化,这种遇到数量少的情况可以用var _TheArray = [[“0-1”,“0-2”],[“1-1”,“1-2”],[“2-1”,“2-2”]]方法二:未知长度的二维数组var tArray = new Array(); //先声明一维for(var k=0;k<i;k++){ //一维长度为i,i为变量,可以根据实际情况改变tArray[k]=new ...
2019-11-21 22:02:37
5946
原创 react-native navigation 返回刷新
<TouchableOpacity onPress={()=>this.turnTo()}> <Text> 123</Text> </TouchableOpacity> turnTo(){ this.props.navigation.n...
2019-11-21 14:44:49
1350
原创 JS获取今天周几
1.初级方法var week = new Date().getDay(),str='今天是星期';if(week === 0){str += '日'}...或者switch..2.中级方法var week = new Date().getDay(),arr = [‘日’, ‘一’, ‘二’, ‘三’, ‘四’, ‘五’, ‘六’],str = ‘今天是星期’+arr[week];...
2019-11-19 16:48:44
3190
原创 react-native Cached Bundles 问题
当打开debugger的时候得到的是Cached Bundles,里面显示Failed to load resource: the server responded with a status of 404 (Not Found)。爆红显示:Runtime is not ready for debuggingMake sure Packager server is runningMake...
2019-10-21 11:26:23
652
原创 RN- Flatlist state更新数据不刷新问题
<FlatList keyExtractor={ () => Math.random(2) } data={this.state.goodList} renderItem={this.renderItem} ItemSeparatorComponent={this.separatorCom...
2019-10-07 17:19:10
2164
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人