自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(258)
  • 资源 (1)
  • 收藏
  • 关注

原创 js轮播插件——swiper loop无线循环下点击跳转无效问题

回调函数onClick不要写在DOM上绑定,而是要写在swiper控件的onClick里面。 onClick: function (swiper, event) { //解决swiper loop下点击无效 let advisorId = swiper.clickedSlide.childNodes[0].dataset....

2018-10-24 10:44:27 2296 1

转载 HTML5中的data-*属性和jQuery中的.data()方法使用

http://blog.csdn.net/fly_zxy/article/details/50687691

2017-09-14 09:47:32 719

原创 VScode格式化代码插件beautify

vscode编辑器格式化react代码插件beautify和react-beautify插件bea命令按下F1,然后输入bea由于我们要格式化JSX代码,所以我们选择第二个选项,然后我们就会发现代码被格式化了。

2017-07-27 15:54:59 51109 2

原创 前端框架Aurelia - feature()

Introduction有时,您拥有完整的组件或相关功能,它们共同构成了一个“特性”。这个“特性”甚至可能是由您的团队中的一组特定的开发人员所拥有的。你想要这些开发者能够管理自己的资源配置和功能,而不干扰其他地区的应用。对于这个场景,水母提供了“特性”特性。想象一下,如上所述,我们有一个my-component组件。想象一下,这是在你的应用中形成了一个逻辑功能的十几个组件之一。与其将该功能的配置逻辑

2017-05-08 14:56:59 1225

原创 前端框架Aurelia - GlobalResources()

Introduction你可能有许多资源需要在多个页面使用。这时候将这些资源做成全局的是明智的。 框架配置class提供了globalResources方法,这个方法的参数是一个或者多个string,这些string是资源的path。 全局的resources不需要在template里面require。 配置Aurelia的文件有一个configure方法。我们项目里面layout文件夹下的i

2017-05-08 14:26:57 804

原创 前端框架Aurelia - 自定义组件

自定义元素(组件)- 含有ViewModel的自定义组件.ts文件 1.首先我们要引入两个依赖!customElement和bindable。 2.下面这个例子还示意了如何给自定义组件绑定属性to,我们使用@bindable来绑定。 3.我们在这里用@customElement(“say-hello”)来定义这个自定义组件的名字,也是我们在使用这个自定义组件的时候的标签名。import {cu

2017-05-08 11:27:22 1557

原创 EventAggregator

http://aurelia.io/hub.html#/doc/api/aurelia/event-aggregator/latest/class/EventAggregatorIntroductionEnables loosely coupled publish/subscribe messaging. new EventAggregator()Methods

2017-05-08 10:44:45 427

原创 前端框架Aurelia —— 路由Router

基本配置为了使用Aurelia的路由,我们的组件view必须有一个元素。为了配置路由,组件的VM需要一个configureRouter()方法。app.html<template> <router-view></router-view></template>Route Configureexport class App { configureRouter(config, router) {

2017-05-04 17:42:37 1658 1

原创 前端框架React - State 和 生命周期

1.Introduction of statethe fact that the Clock sets up a timer and updates the UI every second should be an implementation detail of the Clock.事实上组件的功能和更新UI的代码应该是组件自己的具体实现细节。ReactDOM

2017-03-26 23:25:56 1164

原创 前端框架React - Components and Props

1.Functional and Class ComponentsThey accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen.控件可以接受任意输入(叫做props),返回要显示在screen上的React

2017-03-26 01:15:39 689

原创 前端框架React - 渲染元素

1.把元素渲染进DOMTo render a React element into a root DOM node, pass both to ReactDOM.render()为了把一个react元素渲染进DOM,把他们两个都传进ReactDOM.render()方法。const element = Hello, world;ReactDOM.render(

2017-03-25 21:46:52 725

原创 前端框架Aurelia - Value Converter

1.Value ConverterAurelia的value converter的改进:The Aurelia ValueConverter interface uses toView and fromView methods, which make it quite clear which direction the data is flowing. This

2017-03-23 20:59:08 795

原创 前端框架Aurelia - Computed Properties

import {computedFrom} from 'aurelia-framework';export class Person { firstName: string = 'John'; lastName: string = 'Doe'; @computedFrom('firstName', 'lastName') get fullName(): string {

2017-03-23 20:17:36 615

原创 前端框架Aurelia - Delegate vs Trigger

1.When use whichThe short answer is: Use delegate except when you cannot use delegate.哈哈哈哈写文档的真的太可爱了。Event delegation is a technique used to improve application performance. It dra

2017-03-23 20:05:54 1120

原创 前端框架Aurelia - Binding Selects(一)

1.IntruductionA  element can serve as a single-select or multiple-select "picker" depending on whether the multiple attribute is present.select元素可以是单选也可以是多选,在于multiple属性是否存在。配置sele

2017-03-23 19:43:04 657

原创 前端框架Aurelia - Binding Radios

1.IntroductionA group of radio inputs is a type of "single select" interface.单选按钮。Aurelia supports two-way binding any type of property to a group of radio inputs.Aurelia支持双向绑定任何类型的属性与

2017-03-23 16:17:39 540

原创 前端框架Aurelia - Binding Checkbox

1.checkedBind a boolean property to an input element's checked attribute using checked.bind="myBooleanProperty".绑定一个bool类型的值给checked属性来决定checkbox是否check。export class App { motherbo

2017-03-22 19:46:48 688

原创 前端框架Aurelia - Class & Style

1.ClassYou can bind a css string or object to an element's style attribute. Use the style attribute's alias, css when doing string interpolation to ensure your application is compatible with I

2017-03-22 15:45:23 614

原创 前端框架Aurelia - 数据绑定bind(二)

1.String Interpolation字符串插值(羞耻的字眼==)String interpolation expressions enable interpolating (surprise!) the result of an expression with text. 将表达式的结果插入text。 example compared string

2017-03-22 15:04:59 916

原创 前端框架Aurelia - 数据绑定bind(一)

1.HTML and SVG AttributesAurelia supports binding HTML and SVG attributes to JavaScript expressions. Attribute binding declarations have three parts: attribute.command="expression".attri

2017-03-22 13:21:25 941

原创 前端框架Aurelia - 依赖注入Dependency Injection(一)

Let's say we have a CustomerEditScreen that needs to load a Customer entity by ID from a web service. We wouldn't want to place all the details of our AJAX implementation inside our CustomerEditSc

2017-03-22 10:04:24 984

原创 前端框架Aurelia——组件Component(二)组件生命周期

constructor() - The view-model's constructor is called first.created(owningView: View, myView: View)The created callback will receive the instance of the "owningView". This is the view that th

2017-03-21 20:19:30 1342

原创 前端框架Aurelia——组件Component(一)

In Aurelia, user interface components are composed of view and view-model pairs.组件由html和.ts或者.js文件为一组。Once instantiated, Aurelia's powerful databinding links the two pieces together allowing c

2017-03-21 19:06:39 1936

转载 <meta http-equiv="X-UA-Compatible" content="IE=Edge">

1,X-UA-Compatible是神马? 文档:https://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible X-UA-Compatible是IE8的一个专有属性,它告诉IE8采用何种IE版本去渲染网页,在html的标签中使用。可以在微软官方文档获取更多介绍。 为什么要用X-UA-Compatible? 

2017-01-04 21:56:22 303

转载 JS 中 this 关键字详解

本文主要解释在JS里面this关键字的指向问题(在浏览器环境下)。首先,必须搞清楚在JS里面,函数的几种调用方式:普通函数调用作为方法来调用作为构造函数来调用使用apply/call方法来调用Function.prototype.bind方法es6箭头函数但是不管函数是按哪种方法来调用的,请记住一点:谁调用这个函数或方法,this关键

2016-12-28 16:03:31 454

转载 Javascript的this用法

作者: 阮一峰日期: 2010年4月30日this是Javascript语言的一个关键字。它代表函数运行时,自动生成的一个内部对象,只能在函数内部使用。比如,  function test(){    this.x = 1;  }随着函数使用场合的不同,this的值会发生变化。但是有一个总的原则,那就是this指的是,调用函数

2016-12-28 15:59:16 253

原创 Typescript(3) 表达式和循环

1.箭头表达式:用来声明匿名函数,消除传统匿名函数的this指针问题。

2016-12-25 23:19:41 2109

原创 Typescript(2) 函数新特性

1.Rest和Spread操作符(...就是操作符)用来声明任意数量的方法参数。function aaa (...args) {}用...声明的参数在调用方法的时候可以传任意数量的参数进来。args是一个数组。2.generator函数:控制函数的执行过程,手工暂停和恢复代码执行。function后面的*号说明

2016-12-25 21:30:38 1983

原创 Typescript(1) 参数新特性

1.参数类型:在参数名称后面使用冒号来制定参数的类型。还可以给方法返回值声明类型,也可以给方法参数声明类型。2.默认参数:在方法的参数声明中,也可以在参数声明后面用等号来指定参数的默认值。注意:带默认值的参数要声明在最后面。3.可选参数:在方法的参数声明后面用问号来标明此参数为可选参数。 注意:可选参数必须声明在必选参数的后面。

2016-12-25 18:37:38 614

转载 JS----构造函数与原型prototype 区别

构造函数方法很好用,但是存在一个浪费内存通过原型法分配的函数是所有对象共享的.通过原型法分配的属性是独立.-----如果你不修改属性,他们是共享 如果我们希望所有的对象使用同一一个函数,最好使用原型法添加函数,这样比较节省内存.例子://----构造函数模式为Cat对象添加一个不变的属性"type"(种类),再添加一个方法eat(吃老

2016-12-22 23:18:37 467

转载 babel - 使用Webpack和Babel来搭建React应用程序

用Webpack(npm install -g webpack)代码打包,Webpack大致需要知道三件事:1)让Webpack知道应用程序或js文件的根目录2)让Webpack知道做何种转换3)让Webpack知道转换后的文件保存在哪里具体来说,大致要做以下几件事情:1)在项目根目录下有一个webpack.config.js文件

2016-12-18 22:15:08 1542

转载 path.resolve(_dirname,filename) __dirname变量

在任何模块文件内部,可以使用__dirname变量获取当前模块文件所在目录的完整绝对路径。在应用程序根目录下新建app.js文件,其中代码如下所示。var testModule1=require('./test/testModule.js');在应用程序根目录下新建一个test子目录,在该目录下新建一个testModule.js文件,其中代码如下所示。console.log

2016-12-18 21:28:01 12897

转载 Node.js Path 模块

Node.js path 模块提供了一些用于处理文件路径的小工具,我们可以通过以下方式引入该模块:var path=require("path")实例创建 main.js 文件,代码如下所示:var path = require("path");// 格式化路径console.log('normalization : ' + path.norm

2016-12-18 21:01:50 385

转载 一小时包教会 —— webpack 入门指南

什么是 webpack?webpack是近期最火的一款模块加载器兼打包工具,它能把各种资源,例如JS(含JSX)、coffee、样式(含less/sass)、图片等都作为模块来使用和处理。我们可以直接使用 require(XXX) 的形式来引入各模块,即使它们可能需要经过编译(比如JSX和sass),但我们无须在上面花费太多心思,因为 webpack 有着各种健全的加载器(load

2016-12-18 16:03:06 408

转载 --save-dev 与 --save区别

https://segmentfault.com/q/1010000005163089说的非常好

2016-12-18 16:00:03 14839 6

转载 npm 常用命令详解

今年上半年在学习gulp的使用,对npm的掌握是必不可少的,经常到npm官网查询文档让我感到不爽,还不如整理了一些常用的命令到自己博客上,于是根据自己的理解简单翻译过来,终于有点输出,想学习npm这块的朋友不可错过这些基础命令,新手出品,对本文有疑惑之处还请同学们不耻下问。很久没有写文章啦,后续也希望自己在nodejs这方面有多点内容产出。本文以Windows平台上做测试,以gulp为示例

2016-12-18 15:55:48 570

转载 javascript自执行函数为什么要把windows作为参数传进去

https://segmentfault.com/q/1010000000311686

2016-12-16 19:29:36 1332

原创 git仓库init遇到的问题

这篇文章讲git讲的不错:http://www.open-open.com/lib/view/open1414396787325.html我遇到的问题:第一次输入git init命令会发生权限的错误,是因为我这个DESKTOP用户没有获得这个文件夹的权限。之后再运行git init就成功初始化了,第一张图第二次命令。刚开始.git文件夹被隐藏了,需要我们把隐藏文件打

2016-11-29 23:45:38 6274 1

转载 Vue.js——60分钟webpack项目模板快速入门

http://www.cnblogs.com/Leo_wl/p/5679680.html

2016-11-29 00:09:25 693

转载 vue init webpack-simple project 报错处理(connect ETIMEDOUT 192.30.253.112)

http://www.cnblogs.com/taiyanghua0522/p/6043942.html1Failed to download repo vuejs-templates/webpack-simple: connect ETIMEDOUT 192.30.253.113:443 

2016-11-28 23:55:46 15397 3

javascript正则表达式全解析文档

javascript正则表达式

2016-07-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除