require

Vue2.5 Web App 项目搭建 (TypeScript版)

匿名 (未验证) 提交于 2019-12-03 00:33:02
参考了几位同行的Blogs和StackOverflow上的许多问答,在原来的ng1加TypeScript以及Webpack的经验基础上,搭建了该项目,核心文件如下,供需要的人参考。 package.json 1 { 2 "name": "app" , 3 "version": "1.0.0" , 4 "description": "App package.json from the documentation, supplemented with testing support" , 5 "author": "" , 6 "private": true , 7 "scripts" : { 8 "dev": "webpack-dev-server -d --inline --hot --env.dev" , 9 "build": "rimraf dist && webpack --progress --hide-modules" 10 }, 11 "dependencies" : { 12 "axios": "^0.18.0" , 13 "bootstrap": "^4.0.0" , 14 "bootstrap-vue": "^2.0.0-rc.2" , 15 "element-ui": "^2.2.2" , 16 "font-awesome": "^4.7.0" , 17

【vue】关于图片路径动态化的问题

匿名 (未验证) 提交于 2019-12-03 00:30:01
<img :src='url'> 此处需要url需要返回一个asset下的一张图片路径,而图片名称则是根据id生成的图片名称, 这样即可解决:src绑定图片途径的问题。 imgSrc() { if (this.userid !== "") { const url = require(`@/assets/${this.userid}.jpg`); return url; } else { return require(`@/assets/default.jpg`); } } 解决方案出自:https://github.com/vuejs/Discussion/issues/202 文章来源: 【vue】关于图片路径动态化的问题

You don't have permission to access / on this server,Forbidden

时光怂恿深爱的人放手 提交于 2019-12-03 00:28:00
wampserver配置虚拟主机Forbidden,apache You don't have permission to access 找到httpd.conf文件(通常在安装apache的conf目录下),用编辑器打开 进入到 DocumentRoot Directory 这一行修改里面的内容 <Directory "${INSTALL_DIR}/www/"> 将Directory后面引号里面的修改成你的项目文件的根目录或者根目录所在的盘符,例如我配置的是D盘下的site,最好写绝对路径 <Directory "D:/site"> 继续找到 Require local Require all granted 重启wamp或者apache即可 来源: https://www.cnblogs.com/vipweb/p/11768964.html

express基础复习(node.js版)

匿名 (未验证) 提交于 2019-12-03 00:27:02
第一部分,express基础 1,express入门 node.js项目中安装express npm install express 1.1 配置express设置 1.2 启动express服务器 var express = require('express'); var app = express(); app.listen(80); 2,配置路由 2.1 实现路由 语法: app.<method>(path,[callback...],callback) 例子: app.get('/',function(req,res){ res.send("Server Root"); }); app.post('/',function(req,res){ res.send("Save Page"); }); 2.2 在路由中应用参数 使用查询字符串: var express = require("express"); var url = require('url'); var app = express(); app.get('/find',function(req,res){ var url_parts = url.parse(req.url,true); var query = url_parse(req.url,true); res.send('Finding Book

CommonJS、AMD/CMD、ES6 Modules 以及 webpack 原理浅析

匿名 (未验证) 提交于 2019-12-03 00:27:02
CommonJS Node.js是 commonJS 规范的主要实践者,它有四个重要的环境变量为模块化的实现提供支持: module、exports、require、global 。实际使用时,用 module.exports 定义当前模块对外输出的接口,用 require 加载模块。 // 定义模块 area.js function area ( radius ) { return Math . PI * radius * radius; } // 在这里写上需要向外暴露的函数、变量 module . exports = { area : area } // 引用自定义的模块时,参数包含路径 var math = require ( ' ./math ' ); math . area ( 2 ); 但是我们并没有直接定义 module、exports、require 这些模块,以及 Node 的 API 文档中提到的 __filename、__dirname 。那么是从何而来呢?其实在编译的过程中,Node 对我们定义的 JS 模块进行了一次基础的包装: ( function ( exports , require , modules , __filename , __dirname )) { ... }) 这样我们便可以访问这些传入的 arguments 以及隔离了彼此的作用域

Issue using Google Analytics with Require.js

若如初见. 提交于 2019-12-03 00:23:27
I'm using require.js ( http://requirejs.org/ ) for a number of functions on my site and so far it seems to be working well. I've run into an issue when trying to include Google Analytics code though. The code seems to refuse to add a utm.gif and is not sending off a beacon to Google. I'm wondering if it's a scope thing. define(function() { var Analytics = {}; Analytics.Apply = function() { var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' ==

Node.js 开发-基础学习

匿名 (未验证) 提交于 2019-12-03 00:22:01
Node.js 使用单线程、事件驱动来实现高并发。这些特性不仅带来巨大的性能提升,还减少了多线程程序设计的复杂性,进而提高了开发效率。 事件驱动(通过回掉函数实现单线程事件驱动)的缺点:不符合开发者的常规线性思路,往往需要把一个完整的逻辑拆分为一个个事件,增加了开发难度和调试难度。 Node.js 最大的特点就是异步式 I/O(或者非阻塞 I/O)与事件紧密结合的编程模式。这种模式与传统的同步式 I/O 线性的编程思路有很大的不同,因为控制流很大程度上要靠事件和回调函数来组织,一个逻辑要拆分为若干个单元。 什么是阻塞(block)呢?线程在执行中如果遇到磁盘读写或网络通信(统称为 I/O 操作),通常要耗费较长的时间,这时操作系统会剥夺这个线程的 CPU 控制权,使其暂停执行,同时将资源让给其他的工作线程,这种线程调度方式称为 阻塞。当 I/O 操作完毕时,操作系统将这个线程的阻塞状态解除,恢复其对CPU的控制权,令其继续执行。这种 I/O 模式就是通常的同步式 I/O(Synchronous I/O)或阻塞式 I/O (Blocking I/O)。 相应地,异步式 I/O (Asynchronous I/O)或非阻塞式 I/O (Non-blocking I/O)则针对所有 I/O 操作不采用阻塞的策略。当线程遇到 I/O 操作时,不会以阻塞的方式等待 I/O

RN swiper 与tabbar 冲突解决方案

匿名 (未验证) 提交于 2019-12-03 00:22:01
React Native第三方react-native-swiper组件可以实现轮播功能,但是在开发安卓应用的时候,如果同时使用了react-navigation的TabNavigator导航,会出现swiper内容不显示的问题 查看了react-native-swiper的github,发现issue中不少人都遇到了这样的问题 issue: https://github.com/leecade/react-native-swiper/issues/389 最后查找资料发现,在安卓机下,如果用到了可滚动组件例如SectionList,ScrollView或者TabNavigator这种可滑动的组建,swiper都无法正确显示, import React, { Component } from 'react' ; import { StyleSheet, Text, View, Image, } from 'react-native' ; import Swiper from 'react-native-swiper' ; export class ImgSwiper extends Component { constructor(props) { super (props); this .state = { swiperShow : false , }; }

关于易宝支付的回调和跨域请求

匿名 (未验证) 提交于 2019-12-03 00:21:02
此次开发是基于小京东商城的开发(ecshop) 1.在支付的SDK里面有个call_back文件,支付的文档里面有个notify参数,里面的地址就写成能访问到call_back.php文件就行,切记,一定要是能访问到此地址 2.易宝支付的服务器会发送一个response参数还有另外一个参数,忽略,response参数里面有所有的订单信息附上代码 define('IN_ECS', true); include (dirname(__FILE__)."/includes/modules/payment/conf.php"); require_once (dirname(__FILE__)."/includes/modules/payment/yibao/YopClient.php"); require_once (dirname(__FILE__)."/includes/modules/payment/yibao/YopClient3.php"); require_once (dirname(__FILE__)."/includes/modules/payment/yibao/Util/YopSignUtils.php"); require (dirname(__FILE__) . '/includes/init.php'); //结果通知返回原文数据 function