支持SSR、升级Vue版本和增加新的icon (#40)

* search component add new style

* update vue version and support ssr

* unit test

* add new icon

* new icon
This commit is contained in:
张敏
2017-06-15 19:46:56 +08:00
committed by Yao
parent 857da3a5ee
commit 0f5972e75e
59 changed files with 370 additions and 204 deletions
+2 -1
View File
@@ -8,7 +8,8 @@
<template v-if="!title">
<ul class="van-actionsheet__list">
<li
v-for="item in actions"
v-for="(item, index) in actions"
:key="index"
class="van-actionsheet__item"
:class="[item.className, item.loading ? 'van-actionsheet__item--loading' : '']"
@click.stop="handleItemClick(item)">
+5 -3
View File
@@ -1,7 +1,9 @@
<template>
<a class="van-badge" :href="url" @click="handleClick" :class="{
'van-badge--select': isSelect
}">
<a
class="van-badge"
:class="{ 'van-badge--select': isSelect }"
:href="url"
@click="handleClick">
<div class="van-badge__active"></div>
<div v-if="info" class="van-badge__info">{{info}}</div>
{{title}}
@@ -18,7 +18,7 @@ export default {
name: 'van-datetime-picker',
components: {
Picker
'van-picker': Picker
},
props: {
@@ -6,12 +6,14 @@ let instance;
const ImagePreviewConstructor = Vue.extend(ImagePreview);
const initInstance = () => {
if (Vue.prototype.$isServer) return;
instance = new ImagePreviewConstructor({
el: document.createElement('div')
});
};
var ImagePreviewBox = images => {
if (Vue.prototype.$isServer) return;
if (!instance) {
initInstance();
}
+1 -1
View File
@@ -2,7 +2,7 @@
<transition name="image-fade">
<div class="van-image-preview" ref="previewContainer" v-show="value">
<van-swipe>
<van-swipe-item v-for="item in images">
<van-swipe-item v-for="(item, index) in images" :key="index">
<img class="van-image-preview__image" @load="handleLoad" :src="item" alt="">
</van-swipe-item>
</van-swipe>
+2 -1
View File
@@ -2,7 +2,8 @@
<div class="van-picker-column" :class="classNames">
<div class="van-picker-column-wrapper" :class="{ dragging: isDragging }" ref="wrapper" :style="{ height: visibleContentHeight + 'px' }">
<div
v-for="item in currentValues"
v-for="(item, index) in currentValues"
:key="index"
class="van-picker-column__item"
:class="{ 'van-picker-column__item--selected': item === currentValue }"
:style="{ height: itemHeight + 'px', lineHeight: itemHeight + 'px' }">
+1
View File
@@ -10,6 +10,7 @@
<div class="van-picker__columns" :class="['van-picker__columns--' + columns.length]">
<picker-column
v-for="(item, index) in columns"
:key="index"
v-model="values[index]"
:values="item.values"
:class-name="item.className"
+3
View File
@@ -1,3 +1,4 @@
import Vue from 'vue';
import { EventEmitter, extend, bindEvents, removeEvents } from './utils';
function Input(host, options) {
@@ -24,6 +25,7 @@ Input.prototype = Object.create(new EventEmitter());
extend(Input.prototype, {
bind: function(host) {
if (Vue.prototype.$isServer) return;
bindEvents(host, 'touchstart mousedown', this.onTouchStart);
if (this.options.listenMoving) {
bindEvents(window, 'touchmove mousemove', this.onTouchMove);
@@ -104,6 +106,7 @@ extend(Input.prototype, {
},
destroy: function() {
if (Vue.prototype.$isServer) return;
removeEvents(this.host, 'touchstart mousedown', this.onTouchStart);
if (this.options.listenMoving) {
removeEvents(window, 'touchmove mousemove', this.onTouchMove);
+2 -2
View File
@@ -4,8 +4,8 @@
<slot></slot>
</div>
<div class="van-swipe__indicators" v-if="showIndicators">
<span class="van-swipe__indicator" v-for="i in swipes.length" :class="{
'van-swipe__indicator--active': currIndex === i -1
<span class="van-swipe__indicator" v-for="(item, index) in swipes.length" :key="index" :class="{
'van-swipe__indicator--active': currIndex === index
}">
</span>
</div>
+18 -11
View File
@@ -1,4 +1,4 @@
'use strict';
import Vue from 'vue';
var extend = Object.assign.bind(Object);
@@ -37,17 +37,24 @@ EventEmitter.prototype = {
}
};
const requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame ||
function(callback, element) {
return window.setTimeout(callback, 1000 / 60);
};
const isSupportRequestAnimationFrame = !Vue.prototype.$isServer &&
(window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame);
const isSupportCancelAnimationFrame = !Vue.prototype.$isServer &&
(window.cancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.msCancelAnimationFrame);
const cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame ||
window.webkitCancelAnimationFrame || window.msRequestAnimationFrame ||
function(id) {
clearTimeout(id);
};
const requestAnimationFrame = isSupportRequestAnimationFrame || function(callback, element) {
return window.setTimeout(callback, 1000 / 60);
};
const cancelAnimationFrame = isSupportCancelAnimationFrame || function(id) {
clearTimeout(id);
};
const bindEvents = (elem, eventNames, fn) => {
eventNames = eventNames.split(/\s+/);
+1
View File
@@ -7,6 +7,7 @@
<div class="van-tabs__nav-bar" :style="navBarStyle" v-if="type === 'line'"></div>
<div
v-for="(tab, index) in tabs"
:key="index"
class="van-tab"
:class="{'van-tab--active': index === curActive}"
ref="tabkey"
Binary file not shown.
+31
View File
@@ -181,6 +181,37 @@ module.exports = {
keywords: ['wap', 'home'],
src: 'wap首页.svg',
css: 'wap-home'
},
{
keywords: ['ecard', 'pay'],
src: '有赞E卡.svg',
css: 'ecard-pay',
'correct_contour_direction': true
},
{
keywords: ['balance', 'pay'],
src: '余额支付.svg',
css: 'balance-pay'
},
{
keywords: ['peer', 'pay'],
src: '找人代付.svg',
css: 'peer-pay'
},
{
keywords: ['credit', 'pay'],
src: '信用卡支付.svg',
css: 'credit-pay'
},
{
keywords: ['debit', 'pay'],
src: '借记卡支付.svg',
css: 'debit-pay'
},
{
keywords: ['other', 'pay'],
src: '其他支付方式.svg',
css: 'other-pay'
}
]
};
+12 -6
View File
@@ -2,11 +2,11 @@
@font-face {
font-family: 'vant-icon';
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-3f0c3903d3.eot');
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-3f0c3903d3.eot?#iefix') format('embedded-opentype'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-3f0c3903d3.woff2') format('woff2'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-3f0c3903d3.woff') format('woff'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-3f0c3903d3.ttf') format('truetype')
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-8d0a704edb.eot');
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-8d0a704edb.eot?#iefix') format('embedded-opentype'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-8d0a704edb.woff2') format('woff2'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-8d0a704edb.woff') format('woff'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-8d0a704edb.ttf') format('truetype')
}
.van-icon {
@@ -79,4 +79,10 @@
.van-icon-password-view:before { content: '\e81d'; } /* '' */
.van-icon-password-not-view:before { content: '\e81e'; } /* '' */
.van-icon-wap-nav:before { content: '\e81f'; } /* '' */
.van-icon-wap-home:before { content: '\e820'; } /* '' */
.van-icon-wap-home:before { content: '\e820'; } /* '' */
.van-icon-ecard-pay:before { content: '\e821'; } /* '' */
.van-icon-balance-pay:before { content: '\e822'; } /* '' */
.van-icon-peer-pay:before { content: '\e823'; } /* '' */
.van-icon-credit-pay:before { content: '\e824'; } /* '' */
.van-icon-debit-pay:before { content: '\e825'; } /* '' */
.van-icon-other-pay:before { content: '\e826'; } /* '' */