ICode9

精准搜索请尝试: 精确搜索
  • SAP Cloud for Customer里一个Promise的实际应用场合2020-05-07 22:04:54

    There are lots of tutorials about promise in the internet. Recently I am studying the frontend code of SAP Cloud for Customer and I come across a real example of how promise is used there. Below is the Passcode logon view. Once Passcode is entered, suppo

  • eladmin项目加载东西太多部署到tomcat上2020-05-07 15:56:24

    首先需要打包,使用npm run build(具体看package.json文件可能是npm run build:prod) 我的使用这个命令会出问题,然后我使用 yarn run build命令打包成功到dist目录下 直接把所有文件复制粘贴到tomcat apache-tomcat-9.0.22\webapps\ROOT目录下运行项目访问http://localhost:8080即可

  • Cannot find module 'xxx',错误解决方法2020-05-07 10:39:45

    错误信息 Cannot find module '@/views/login/index' Failed to resolve async component default vue-router.esm.js:1897 Error: Cannot find module '@/views/login/index' at webpackEmptyContext (index.js:39) at permission.js:90 解决方法 进入router中的in

  • react配置less步骤2020-05-06 22:02:36

    react配置less react官方标准脚手架中不支持less 1.需要将配置抛出 2.在webpack.config.js中更改配置      a。const lessRegex = /\.less$/;      const lessModuleRegex = /\.module\.less$/;        b。   getStyleLoaders方法中添加less的loader   c

  • webpack can't resolve modules2020-05-06 12:08:30

    1、要检查 项目内有没有这个文件,如果是插件,是否安装上     自己定义的文件,有可能是引用路径写错,或者没有定义;如果是插件,可能因为网络问题没安装成功,或者路径问题,没有安装在指定目录下   2、如果存在此文件,而且路径正确,可以排查一下 是不是项目解析问题 参考 webpack官网 https:

  • promise-api2020-05-06 12:03:01

    promise基础用法 const a = 1,b=2; //promise基础用法 const laopo = new Promise((resolve,reject)=>{ if(a == 2){ resolve(a); }else{ reject(a-1); } }) laopo.then(res=>{ console.log('

  • [JS]promises对象2020-05-05 13:44:20

    目录什么是promise怎么使用XMLHttpRequest 执行 promise简写,使用then换成catch换成finally需要注意总结参考链接 什么是promise Promise 是一个对象,它代表了一个异步 操作的最终完成或者失败。 Promise 构造函数包含一个参数和一个带有 resolve(解析)和 reject(拒绝)两个参数

  • Promise 学习笔记2020-05-03 20:38:46

    目录 1. Promise 基本结构 2. Promise 状态和值 3. Promise 的 then 方法 4. Promise基本实现 5. Promise零碎知识 Promise 用法 :MDN Promise Promise 底层实现 :Promise实现原理(附源码) (本文学习并参考的一篇博客,推荐直接阅读) 其他推荐:Promise简单实现 (一)Promise 基本结

  • 解决React在安装antd之后出现的Can't resolve './locale'问题2020-05-03 20:37:52

    React在安装antd之后出现的Can’t resolve './locale’问题,是因为moment在2.2之后的版本都有问题,而react默认使用了最新的moment,但是在moment@2.18.1中是没有问题的。 解决方案就是配置webpack的alias,将所有的 moment 路径引用导入到 moment@2.18.1 操作步骤 安装momen

  • vue.config.js优化配置2020-04-30 15:58:39

    vue-cli3优化配置     1.使用cdn引入不改变的第三方库 const cdn = { // 忽略打包的第三方库 externals: { vue: 'Vue', vuex: 'Vuex', 'vue-router': 'VueRouter', axios: 'axios' }, // 通过cdn方式使用 js: [ 'ht

  • Javascript Promises学习2020-04-28 21:56:06

    Promise对象的三个状态 pending(进行中) fulfilled(已成功) rejected(已失败) Promise代表一个异步操作,对象的状态一旦改变,就不会再改变 Promise构造函数接受一个函数作为参数,该函数的两个参数分别是resolve和reject`。它们是两个函数,由 JavaScript 引擎提供,不用自己部署。

  • async 与await 解析2020-04-28 19:55:47

      async与await 是promise的语法糖,是把promise的异步写成像同步的写法。 语法:   1、async 后面接一个自定义函数   2、await 只能放在async 后面的函数里,且await后面接一个会 ruturn new Promise 的函数,等到异步完成就继续往下执行 function hello(){ return new Promi

  • vue.config.js内容解释2020-04-28 17:54:57

    一、为甚么引入 path 模块 path 模块,提供了一些工具函数,用于处理文件与目录的路径。path.join()方法用于连接路径,该方法会正确识别当前系统的路径分隔符,如Unix系统是”/“,Windows系统是”\“。__dirname 是node的一个全局变量,即获得当前文件所在目录的完整目录名。 const path =

  • vue使用@路径引入,vue.config.js配置2020-04-28 10:52:22

    项目中使用引入文件有时候路径比较深,需要使用"../../../xx.js"这种类似的路劲引入,这种方式比较笨,可以使用webpack的别名alias配置来解决。 首先,先确定项目中是否有path模块: 如果没有path模块需要先安装path npm install path --save    以下为vue.config.js配置 const pa

  • IDEA显示cannot resolve symbol XXX2020-04-25 10:04:33

    1、菜单 “File” -> “Invalidate Caches / Restart”→ “Invalidate and Restart” https://blog.csdn.net/weixin_37497666/article/details/99842689 2、自己导的包,手动用命令把jar包添加到maven依赖中 https://blog.csdn.net/MaNongXf/article/details/84034065 3、项目中

  • vue-router addRoutes2020-04-23 22:02:22

    let routes = [ { path: "/cover/:id", component: resolve => require(['./cover.vue'], resolve), name: "cover", },] this.$router.options.routes.push(routes);

  • 【问题】js 之 await ~ 再探索2020-04-19 14:06:06

    参考文档  (小白提供)(另 刚看历史喵 原来 历史上的曾经有个叫管仲的 也叫小白,而且是个扛把子哦!!!)  另一个参考文档  没有return的场合 async function gen(){ await Promise.resolve(1) console.log('gne1') await Promise.resolve(1) console.log('gne2') await Promise.

  • 55. 跳跃游戏2020-04-17 14:05:20

    <> 题目描述 给定一个非负整数数组,你最初位于数组的第一个位置。 数组中的每个元素代表你在该位置可以跳跃的最大长度。 判断你是否能够到达最后一个位置。 示例 1: 输入: [2,3,1,1,4] 输出: true 解释: 我们可以先跳 1 步,从位置 0 到达 位置 1, 然后再从位置 1 跳 3 步到达最

  • vue 图片优化2020-04-17 14:00:04

    npm i image-conversion --save # or yarn add image-conversion import { compress, compressAccurately } from "image-conversion"; // 要用前先引用   handleBefore(file) {       /** 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promis

  • JS11 -- 同步异步2020-04-16 09:57:53

    var oPromise = new Promise(function (resolve,reject) {});      // resolve成功,reject失败   Promise.all(['对象1',对象2"]).then(function () {//对象1、对象2请求成功,执行})   Promise.race(['对象1',对象2"]).then(function () {//对象1、对象2谁最快请求成功,执行}

  • webpack3.x配置2020-04-15 18:08:31

    编辑本随笔 alias路径别名 需要使用path方法 resolve: { alias: { 'vue$': 'vue/dist/vue.esm.js', '@': path.resolve(__dirname, 'src') }, extensions: ['*', '.js', '.vue', '.jso

  • ES6---Promise应用: async, await2020-04-15 17:59:30

    ES6---Promise应用: async, await   1. k2 var k1 = new Promise((resolve, reject) => { resolve('ok'); }) console.log(k1); async function k2() { } console.log(k2);   console:    2. 

  • 用promise实现一个promise.all2020-04-08 12:01:34

    用promise实现一个promise.all let PromiseAll = (promises)=>{ return new Promise((resolve, reject)=>{ let results = new Array(promises.length) for(let i=0;i<promises.length;i++){ let promise = promises[i] pro

  • flutter踩坑01:下载包失败:Could not resolve all artifacts for configuration....2020-04-07 19:00:55

    flutter踩坑01:下载包失败:Could not resolve all artifacts for configuration.... flutter在下载依赖失败或者flutter run运行的时候出现某个jar或者文件下载失败的时候,如下: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring pr

  • Maven更新失败,Cannot resolve plugin org.apache.maven.plugins:maven-compiler-plugin:3.12020-04-06 13:05:45

    Maven更新问题 今天Maven在更新的时候发现一直更新不成功,总结下解决方法。 在apache-maven-3.5.2/conf/setting.xml中加入以下配置即可解决 <!--解决依赖编译不过问题--> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有