原创 使用nrm管理npm源
首先安裝nrm npm install nrm -g 查看nrm命令 nrm -h ls查看所有的npm源 current查看當前使用的 use使用某個源 add添加私有
原创 node 使用nodemon自啓動服務
安裝nodemon npm install nodemon -D 修改啓動命令 "start": "nodemon demo.js", 重新啓動即可
原创 js判斷一個數組中含有另一個數組的某一項
let Arr=[1,2,3,4,5,6], Data=[5,6,7]; Arr.find(i=>Data.includes(i)) 如果有相同項就返回對應的一項,沒有相同項,結果是undefined
原创 React Native 快速搭建商城項目基礎結構
一、init指定項目版本(如果直接使用最新版可不要後綴 --verbose --version 0.52.0) react-native init demo --verbose --version 0.52.0 二、引入必要插
原创 express簡單使用
安裝express框架 npm install express -S express引入使用 Hello world example const express = require('express') const app =
原创 React Native Android打包時報錯:Execution failed for task ':app:lintVitalRelease'.
報錯截圖: 解決方案: 在android/build.gradle文件中的android方法下加上以下方法即可: lintOptions { checkReleaseBuilds false ab
原创 React Native打包Android報錯:AAPT: error: resource android:attr/fontVariationSettings not found.
報錯截圖: 版本信息: 1.android/build.gradle buildscript { ext { buildToolsVersion = "27.0.3" minSdkVers
原创 使用alita 將React Native項目轉化爲小程序
1.通過npm全局安裝alita npm install -g @areslabs/alita 2.官方文檔說明可以直接通過react native init一份項目直接轉化,不過試了試,有問題,小程序一直報未找到入口文件 ap
原创 react native:運行react-native run-ios報錯Error: Could not find iPhone X simulator解決辦法
報錯代碼: Found Xcode project ****.xcodeproj Could not find iPhone X simulator Error: Could not find iPhone X simulat
原创 react native打包是報錯:com.android.builder.internal.aapt.AaptException: libpng error: Not a PNG file
在終端的報錯信息: > Task :app:mergeReleaseResources Error: java.util.concurrent.ExecutionException: com.android.builder.in
原创 react-native run-android 時報錯 AAPT: error: resource android:attr/fontVariationSettings not found.
解決方案: 在android/app/build.gradle文件中加入以下代碼 configurations.all { resolutionStrategy { force 'com.google.
原创 最新版React-navigation報錯:Invariant Violation: The navigation prop is missing for this navigator.
使用createStackNavigator這個組件時出現瞭如下錯誤: 錯誤原因: 在react-navigationV3中,需要手動添加createAppContainer 解決方案:
原创 react-navigation禁止側滑
在createStackNavigator後加上一下方法: defaultNavigationOptions: { gesturesEnabled: false, },
原创 React Native視頻加字幕(內加外)
直接貼代碼吧: import React from 'react'; import {View, ScrollView} from 'react-native'; import axios from "axios" import
原创 react配置eslint讓代碼更規範
1.安裝eslint-plugin-react-hooks npm i eslint-plugin-react-hooks -D 2.配置eslint,在package.json 文件中