mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-22 06:31:46 +08:00
[build] 0.4.8
This commit is contained in:
parent
294cd3d77e
commit
2b06095587
2
dist/button/index.js
vendored
2
dist/button/index.js
vendored
@ -31,7 +31,7 @@ VantComponent({
|
||||
square = _this$data.square,
|
||||
loading = _this$data.loading,
|
||||
disabled = _this$data.disabled;
|
||||
return this.classNames('custom-class', 'van-button', "van-button--" + type, "van-button--" + size, {
|
||||
return this.classNames('van-button', "van-button--" + type, "van-button--" + size, {
|
||||
'van-button--block': block,
|
||||
'van-button--round': round,
|
||||
'van-button--plain': plain,
|
||||
|
2
dist/button/index.wxml
vendored
2
dist/button/index.wxml
vendored
@ -1,7 +1,7 @@
|
||||
<button
|
||||
id="{{ id }}"
|
||||
lang="{{ lang }}"
|
||||
class="{{ classes }}"
|
||||
class="custom-class {{ classes }}"
|
||||
open-type="{{ openType }}"
|
||||
session-from="{{ sessionFrom }}"
|
||||
app-parameter="{{ appParameter }}"
|
||||
|
6
dist/cell/index.js
vendored
6
dist/cell/index.js
vendored
@ -24,7 +24,7 @@ VantComponent({
|
||||
computed: {
|
||||
cellClass: function cellClass() {
|
||||
var data = this.data;
|
||||
return this.classNames('custom-class', 'van-cell', {
|
||||
return this.classNames('van-cell', {
|
||||
'van-cell--center': data.center,
|
||||
'van-cell--required': data.required,
|
||||
'van-cell--borderless': !data.border,
|
||||
@ -35,10 +35,6 @@ VantComponent({
|
||||
titleStyle: function titleStyle() {
|
||||
var titleWidth = this.data.titleWidth;
|
||||
return titleWidth ? "max-width: " + titleWidth + ";min-width: " + titleWidth : '';
|
||||
},
|
||||
iconWrapClass: function iconWrapClass() {
|
||||
var prefix = 'van-cell__right-icon-wrap right-icon-class';
|
||||
return this.classNames(prefix, prefix + "--" + this.data.arrowDirection);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
6
dist/cell/index.wxml
vendored
6
dist/cell/index.wxml
vendored
@ -1,5 +1,5 @@
|
||||
<view
|
||||
class="{{ cellClass }}"
|
||||
class="custom-class {{ cellClass }}"
|
||||
style="{{ customStyle }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
@ -29,8 +29,8 @@
|
||||
|
||||
<van-icon
|
||||
wx:if="{{ isLink }}"
|
||||
name="arrow"
|
||||
class="{{ iconWrapClass }}"
|
||||
name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}"
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
custom-class="van-cell__right-icon"
|
||||
/>
|
||||
<slot wx:else name="right-icon" />
|
||||
|
2
dist/cell/index.wxss
vendored
2
dist/cell/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:18px;color:#7d7e80}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px}.van-cell__left-icon-wrap{margin-right:5px;font-size:16px}.van-cell__right-icon-wrap{margin-left:5px;font-size:12px;color:#999}.van-cell__right-icon-wrap--left{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-cell__right-icon-wrap--up{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-cell__right-icon-wrap--down{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px}
|
||||
@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:18px;color:#7d7e80}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;font-size:16px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px}
|
2
dist/checkbox/index.wxss
vendored
2
dist/checkbox/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-checkbox{overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{display:inline-block;line-height:20px;vertical-align:middle}.van-checkbox__icon{box-sizing:border-box;display:block;width:20px;height:20px;border:1px solid #e5e5e5;color:transparent;font-size:12px;text-align:center;transition:.2s}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;border-color:#1989fa;background-color:#1989fa}.van-checkbox__icon--disabled{border-color:#eee;background-color:currentColor;color:#f8f8f8}.van-checkbox__icon--disabled.van-checkbox__icon--checked{border-color:#eee;background-color:#eee}.van-checkbox__label{margin-left:10px}.van-checkbox__label--left{margin:0 10px 0 0;float:left}.van-checkbox__label:empty{margin:0}
|
||||
@import '../common/index.wxss';.van-checkbox{overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{display:inline-block;line-height:20px;vertical-align:middle}.van-checkbox__icon{box-sizing:border-box;display:block;width:20px;height:20px;border:1px solid #e5e5e5;color:transparent;font-size:14px;text-align:center;transition:.2s}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;border-color:#1989fa;background-color:#1989fa}.van-checkbox__icon--disabled{border-color:#eee;background-color:currentColor;color:#f8f8f8}.van-checkbox__icon--disabled.van-checkbox__icon--checked{border-color:#eee;background-color:#eee}.van-checkbox__label{margin-left:10px}.van-checkbox__label--left{margin:0 10px 0 0;float:left}.van-checkbox__label:empty{margin:0}
|
2
dist/col/index.js
vendored
2
dist/col/index.js
vendored
@ -16,7 +16,7 @@ VantComponent({
|
||||
var _this$data = this.data,
|
||||
span = _this$data.span,
|
||||
offset = _this$data.offset;
|
||||
return this.classNames('custom-class', 'van-col', {
|
||||
return this.classNames('van-col', {
|
||||
["van-col--" + span]: span,
|
||||
["van-col--offset-" + offset]: offset
|
||||
});
|
||||
|
2
dist/col/index.wxml
vendored
2
dist/col/index.wxml
vendored
@ -1,5 +1,5 @@
|
||||
<view
|
||||
class="{{ classes }}"
|
||||
class="custom-class {{ classes }}"
|
||||
style="{{ style }}"
|
||||
>
|
||||
<slot />
|
||||
|
6
dist/common/utils.js
vendored
6
dist/common/utils.js
vendored
@ -11,4 +11,8 @@ function isNumber(value) {
|
||||
return /^\d+$/.test(value);
|
||||
}
|
||||
|
||||
export { isObj, isDef, isNumber };
|
||||
function isSrc(url) {
|
||||
return /^(https?:)?\/\/|data:image/.test(url);
|
||||
}
|
||||
|
||||
export { isObj, isDef, isSrc, isNumber };
|
9
dist/dialog/dialog.js
vendored
9
dist/dialog/dialog.js
vendored
@ -8,6 +8,7 @@ function getContext() {
|
||||
}
|
||||
|
||||
var Dialog = function Dialog(options) {
|
||||
options = _extends({}, Dialog.currentOptions, options);
|
||||
return new Promise(function (resolve, reject) {
|
||||
var context = options.context || getContext();
|
||||
var dialog = context.selectComponent(options.selector);
|
||||
@ -32,6 +33,7 @@ Dialog.defaultOptions = {
|
||||
zIndex: 100,
|
||||
overlay: true,
|
||||
asyncClose: false,
|
||||
transition: 'scale',
|
||||
selector: '#van-dialog',
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
@ -40,13 +42,10 @@ Dialog.defaultOptions = {
|
||||
closeOnClickOverlay: false,
|
||||
confirmButtonOpenType: ''
|
||||
};
|
||||
|
||||
Dialog.alert = function (options) {
|
||||
return Dialog(_extends({}, Dialog.currentOptions, options));
|
||||
};
|
||||
Dialog.alert = Dialog;
|
||||
|
||||
Dialog.confirm = function (options) {
|
||||
return Dialog(_extends({}, Dialog.currentOptions, {
|
||||
return Dialog(_extends({
|
||||
showCancelButton: true
|
||||
}, options));
|
||||
};
|
||||
|
4
dist/dialog/index.js
vendored
4
dist/dialog/index.js
vendored
@ -30,6 +30,10 @@ VantComponent({
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
transition: {
|
||||
type: String,
|
||||
value: 'scale'
|
||||
}
|
||||
},
|
||||
data: {
|
||||
|
2
dist/dialog/index.wxml
vendored
2
dist/dialog/index.wxml
vendored
@ -1,9 +1,9 @@
|
||||
<van-popup
|
||||
show="{{ show }}"
|
||||
transition="scale"
|
||||
z-index="{{ zIndex }}"
|
||||
overlay="{{ overlay }}"
|
||||
custom-class="van-dialog"
|
||||
transition="{{ transition }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
bind:close="onClickOverlay"
|
||||
>
|
||||
|
50
dist/field/index.js
vendored
50
dist/field/index.js
vendored
@ -20,12 +20,17 @@ VantComponent({
|
||||
inputAlign: String,
|
||||
customClass: String,
|
||||
confirmType: String,
|
||||
confirmHold: Boolean,
|
||||
errorMessage: String,
|
||||
placeholder: String,
|
||||
customStyle: String,
|
||||
useIconSlot: Boolean,
|
||||
useButtonSlot: Boolean,
|
||||
placeholderStyle: String,
|
||||
adjustPosition: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
cursorSpacing: {
|
||||
type: Number,
|
||||
value: 50
|
||||
@ -66,27 +71,49 @@ VantComponent({
|
||||
},
|
||||
methods: {
|
||||
onInput: function onInput(event) {
|
||||
var _this = this;
|
||||
|
||||
var _ref = event.detail || {},
|
||||
_ref$value = _ref.value,
|
||||
value = _ref$value === void 0 ? '' : _ref$value;
|
||||
|
||||
this.$emit('input', value);
|
||||
this.$emit('change', value);
|
||||
this.setData({
|
||||
value: value,
|
||||
showClear: this.getShowClear(value)
|
||||
}, function () {
|
||||
_this.$emit('input', value);
|
||||
|
||||
_this.$emit('change', value);
|
||||
});
|
||||
},
|
||||
onFocus: function onFocus() {
|
||||
this.$emit('focus');
|
||||
onFocus: function onFocus(event) {
|
||||
var _ref2 = event.detail || {},
|
||||
_ref2$value = _ref2.value,
|
||||
value = _ref2$value === void 0 ? '' : _ref2$value,
|
||||
_ref2$height = _ref2.height,
|
||||
height = _ref2$height === void 0 ? 0 : _ref2$height;
|
||||
|
||||
this.$emit('focus', {
|
||||
value: value,
|
||||
height: height
|
||||
});
|
||||
this.focused = true;
|
||||
this.setData({
|
||||
showClear: this.getShowClear()
|
||||
});
|
||||
},
|
||||
onBlur: function onBlur() {
|
||||
onBlur: function onBlur(event) {
|
||||
var _ref3 = event.detail || {},
|
||||
_ref3$value = _ref3.value,
|
||||
value = _ref3$value === void 0 ? '' : _ref3$value,
|
||||
_ref3$cursor = _ref3.cursor,
|
||||
cursor = _ref3$cursor === void 0 ? 0 : _ref3$cursor;
|
||||
|
||||
this.$emit('blur', {
|
||||
value: value,
|
||||
cursor: cursor
|
||||
});
|
||||
this.focused = false;
|
||||
this.$emit('blur');
|
||||
this.setData({
|
||||
showClear: this.getShowClear()
|
||||
});
|
||||
@ -99,13 +126,18 @@ VantComponent({
|
||||
return this.data.clearable && this.focused && value && !this.data.readonly;
|
||||
},
|
||||
onClear: function onClear() {
|
||||
var _this2 = this;
|
||||
|
||||
this.setData({
|
||||
value: '',
|
||||
showClear: this.getShowClear('')
|
||||
}, function () {
|
||||
_this2.$emit('input', '');
|
||||
|
||||
_this2.$emit('change', '');
|
||||
|
||||
_this2.$emit('clear', '');
|
||||
});
|
||||
this.$emit('input', '');
|
||||
this.$emit('change', '');
|
||||
this.$emit('clear', '');
|
||||
},
|
||||
onConfirm: function onConfirm() {
|
||||
this.$emit('confirm', this.data.value);
|
||||
|
4
dist/field/index.wxml
vendored
4
dist/field/index.wxml
vendored
@ -9,6 +9,7 @@
|
||||
title-width="{{ titleWidth }}"
|
||||
custom-class="van-field"
|
||||
>
|
||||
<slot name="left-icon" slot="icon" />
|
||||
<slot name="label" slot="title" />
|
||||
<view class="van-field__body {{ type === 'textarea' ? 'van-field__body--textarea' : '' }}">
|
||||
<textarea
|
||||
@ -24,6 +25,7 @@
|
||||
placeholder-style="{{ placeholderStyle }}"
|
||||
placeholder-class="{{ error ? 'van-field--error' : '' }}"
|
||||
cursor-spacing="{{ cursorSpacing }}"
|
||||
adjust-position="{{ adjustPosition }}"
|
||||
bindinput="onInput"
|
||||
bind:blur="onBlur"
|
||||
bind:focus="onFocus"
|
||||
@ -41,7 +43,9 @@
|
||||
placeholder-style="{{ placeholderStyle }}"
|
||||
placeholder-class="{{ error ? 'van-field--error' : '' }}"
|
||||
confirm-type="{{ confirmType }}"
|
||||
confirm-hold="{{ confirmHold }}"
|
||||
cursor-spacing="{{ cursorSpacing }}"
|
||||
adjust-position="{{ adjustPosition }}"
|
||||
bindinput="onInput"
|
||||
bind:blur="onBlur"
|
||||
bind:focus="onFocus"
|
||||
|
6
dist/icon/index.js
vendored
6
dist/icon/index.js
vendored
@ -1,3 +1,4 @@
|
||||
import { isSrc as _isSrc } from '../common/utils';
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
props: {
|
||||
@ -11,6 +12,11 @@ VantComponent({
|
||||
value: 'van-icon'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isSrc: function isSrc() {
|
||||
return _isSrc(this.data.name);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClick: function onClick() {
|
||||
this.$emit('click');
|
||||
|
13
dist/icon/index.wxml
vendored
13
dist/icon/index.wxml
vendored
@ -1,7 +1,16 @@
|
||||
<view
|
||||
class="custom-class {{ classPrefix }} {{ classPrefix }}-{{ name }}"
|
||||
class="custom-class {{ classPrefix }} {{ isSrc ? 'van-icon--image' : classPrefix + '-' + name }}"
|
||||
style="{{ color ? 'color: ' + color + ';' : '' }}{{ size ? 'font-size: ' + size + ';' : '' }}{{ customStyle }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view>
|
||||
<view
|
||||
wx:if="{{ info !== null }}"
|
||||
class="van-icon__info"
|
||||
>
|
||||
{{ info }}
|
||||
</view>
|
||||
<image
|
||||
wx:if="{{ isSrc }}"
|
||||
src="{{ name }}"
|
||||
/>
|
||||
</view>
|
||||
|
2
dist/icon/index.wxss
vendored
2
dist/icon/index.wxss
vendored
File diff suppressed because one or more lines are too long
6
dist/nav-bar/index.js
vendored
6
dist/nav-bar/index.js
vendored
@ -3,10 +3,14 @@ VantComponent({
|
||||
classes: ['title-class'],
|
||||
props: {
|
||||
title: String,
|
||||
fixed: Boolean,
|
||||
leftText: String,
|
||||
rightText: String,
|
||||
leftArrow: Boolean,
|
||||
fixed: Boolean,
|
||||
border: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 1
|
||||
|
5
dist/nav-bar/index.wxml
vendored
5
dist/nav-bar/index.wxml
vendored
@ -1,12 +1,13 @@
|
||||
<view
|
||||
class="custom-class van-nav-bar van-hairline--bottom {{ fixed ? 'van-nav-bar--fixed' : '' }}"
|
||||
class="custom-class van-nav-bar {{ border ? 'van-hairline--bottom' : '' }} {{ fixed ? 'van-nav-bar--fixed' : '' }}"
|
||||
style="z-index: {{ zIndex }}"
|
||||
>
|
||||
<view class="van-nav-bar__left" bind:tap="onClickLeft">
|
||||
<block wx:if="{{ leftArrow || leftText }}">
|
||||
<van-icon
|
||||
wx:if="{{ leftArrow }}"
|
||||
name="arrow"
|
||||
size="16px"
|
||||
name="arrow-left"
|
||||
custom-class="van-nav-bar__arrow"
|
||||
/>
|
||||
<view wx:if="{{ leftText }}" class="van-nav-bar__text">{{ leftText }}</view>
|
||||
|
2
dist/nav-bar/index.wxss
vendored
2
dist/nav-bar/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-nav-bar{height:46px;position:relative;-webkit-user-select:none;user-select:none;text-align:center;line-height:46px;background-color:#fff}.van-nav-bar__arrow{color:#1989fa;vertical-align:middle;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{top:0;left:0;width:100%;position:fixed}.van-nav-bar__title{margin:0 auto;max-width:60%;font-size:16px;font-weight:500}.van-nav-bar__left,.van-nav-bar__right{bottom:0;font-size:14px;position:absolute}.van-nav-bar__left{left:15px}.van-nav-bar__right{right:15px}.van-nav-bar__text{color:#1989fa;margin:0 -15px;padding:0 15px;display:inline-block;vertical-align:middle}.van-nav-bar__text:active{background-color:#e8e8e8}
|
||||
@import '../common/index.wxss';.van-nav-bar{height:46px;position:relative;-webkit-user-select:none;user-select:none;text-align:center;line-height:46px;background-color:#fff}.van-nav-bar__arrow{color:#1989fa;vertical-align:middle}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{top:0;left:0;width:100%;position:fixed}.van-nav-bar__title{margin:0 auto;max-width:60%;font-size:16px;font-weight:500}.van-nav-bar__left,.van-nav-bar__right{bottom:0;font-size:14px;position:absolute}.van-nav-bar__left{left:15px}.van-nav-bar__right{right:15px}.van-nav-bar__text{color:#1989fa;margin:0 -15px;padding:0 15px;display:inline-block;vertical-align:middle}.van-nav-bar__text:active{background-color:#e8e8e8}
|
8
dist/rate/index.js
vendored
8
dist/rate/index.js
vendored
@ -10,6 +10,14 @@ VantComponent({
|
||||
type: Number,
|
||||
value: 20
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
value: 'star'
|
||||
},
|
||||
voidIcon: {
|
||||
type: String,
|
||||
value: 'star-o'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
value: '#ffd21e'
|
||||
|
2
dist/rate/index.wxml
vendored
2
dist/rate/index.wxml
vendored
@ -8,7 +8,7 @@
|
||||
class="van-rate__item"
|
||||
size="{{ size }}px"
|
||||
data-index="{{ index }}"
|
||||
name="{{ item ? 'star' : 'star-o' }}"
|
||||
name="{{ item ? icon : voidIcon }}"
|
||||
color="{{ disabled ? disabledColor : item ? color : voidColor }}"
|
||||
bind:click="onSelect"
|
||||
/>
|
||||
|
2
dist/switch/index.js
vendored
2
dist/switch/index.js
vendored
@ -22,7 +22,7 @@ VantComponent({
|
||||
},
|
||||
computed: {
|
||||
classes: function classes() {
|
||||
return this.classNames('custom-class', 'van-switch', {
|
||||
return this.classNames('van-switch', {
|
||||
'van-switch--on': this.data.checked,
|
||||
'van-switch--disabled': this.data.disabled
|
||||
});
|
||||
|
2
dist/switch/index.wxml
vendored
2
dist/switch/index.wxml
vendored
@ -1,6 +1,6 @@
|
||||
<view
|
||||
style="{{ style }}"
|
||||
class="{{ classes }}"
|
||||
class="custom-class {{ classes }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<view class="van-switch__node node-class">
|
||||
|
4
dist/tab/index.js
vendored
4
dist/tab/index.js
vendored
@ -10,7 +10,9 @@ VantComponent({
|
||||
},
|
||||
data: {
|
||||
inited: false,
|
||||
active: false
|
||||
active: false,
|
||||
animated: false,
|
||||
width: null
|
||||
},
|
||||
watch: {
|
||||
title: 'update',
|
||||
|
6
dist/tab/index.wxml
vendored
6
dist/tab/index.wxml
vendored
@ -1,7 +1,7 @@
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class van-tab__pane"
|
||||
style="{{ active ? '' : 'display: none' }}"
|
||||
wx:if="{{ animated || inited }}"
|
||||
class="custom-class van-tab__pane {{ animated ? 'van-tab__pane--float' : '' }}"
|
||||
style="{{ animated || active ? '' : 'display: none;' }} {{ width ? 'width:' + width + 'px;' : '' }}"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
|
1
dist/tab/index.wxss
vendored
Normal file
1
dist/tab/index.wxss
vendored
Normal file
@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box}.van-tab__pane--float{float:left}
|
7
dist/tabbar-item/index.wxml
vendored
7
dist/tabbar-item/index.wxml
vendored
@ -3,7 +3,12 @@
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<view class="van-tabbar-item__icon {{ dot ? 'van-tabbar-item__icon--dot' : '' }}">
|
||||
<van-icon wx:if="{{ icon }}" name="{{ icon }}" info="{{ info }}" />
|
||||
<van-icon
|
||||
wx:if="{{ icon }}"
|
||||
name="{{ icon }}"
|
||||
info="{{ info }}"
|
||||
customStyle="display: block"
|
||||
/>
|
||||
<block wx:else>
|
||||
<slot wx:if="{{ active }}" name="icon-active" />
|
||||
<slot wx:else name="icon" />
|
||||
|
58
dist/tabs/index.js
vendored
58
dist/tabs/index.js
vendored
@ -35,7 +35,7 @@ VantComponent({
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
value: 0.2
|
||||
value: 0.3
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
@ -44,13 +44,15 @@ VantComponent({
|
||||
swipeThreshold: {
|
||||
type: Number,
|
||||
value: 4
|
||||
}
|
||||
},
|
||||
animated: Boolean
|
||||
},
|
||||
data: {
|
||||
tabs: [],
|
||||
lineStyle: '',
|
||||
scrollLeft: 0,
|
||||
scrollable: false
|
||||
scrollable: false,
|
||||
trackStyle: ''
|
||||
},
|
||||
watch: {
|
||||
swipeThreshold: function swipeThreshold() {
|
||||
@ -60,13 +62,15 @@ VantComponent({
|
||||
},
|
||||
color: 'setLine',
|
||||
lineWidth: 'setLine',
|
||||
active: 'setActiveTab'
|
||||
active: 'setActiveTab',
|
||||
animated: 'setTrack'
|
||||
},
|
||||
beforeCreate: function beforeCreate() {
|
||||
this.child = [];
|
||||
},
|
||||
mounted: function mounted() {
|
||||
this.setLine();
|
||||
this.setTrack();
|
||||
this.scrollIntoView();
|
||||
},
|
||||
methods: {
|
||||
@ -128,12 +132,38 @@ VantComponent({
|
||||
});
|
||||
});
|
||||
},
|
||||
setActiveTab: function setActiveTab() {
|
||||
setTrack: function setTrack() {
|
||||
var _this2 = this;
|
||||
|
||||
var _this$data2 = this.data,
|
||||
animated = _this$data2.animated,
|
||||
active = _this$data2.active,
|
||||
duration = _this$data2.duration;
|
||||
if (!animated) return '';
|
||||
this.getRect('.van-tabs__content').then(function (rect) {
|
||||
var width = rect.width;
|
||||
|
||||
_this2.setData({
|
||||
trackStyle: "\n width: " + width * _this2.child.length + "px;\n transform: translateX(" + -1 * active * width + "px);\n transition-duration: " + duration + "s;\n "
|
||||
});
|
||||
|
||||
_this2.setTabsProps({
|
||||
width: width,
|
||||
animated: animated
|
||||
});
|
||||
});
|
||||
},
|
||||
setTabsProps: function setTabsProps(props) {
|
||||
this.child.forEach(function (item) {
|
||||
item.setData(props);
|
||||
});
|
||||
},
|
||||
setActiveTab: function setActiveTab() {
|
||||
var _this3 = this;
|
||||
|
||||
this.child.forEach(function (item, index) {
|
||||
var data = {
|
||||
active: index === _this2.data.active
|
||||
active: index === _this3.data.active
|
||||
};
|
||||
|
||||
if (data.active) {
|
||||
@ -145,30 +175,32 @@ VantComponent({
|
||||
}
|
||||
});
|
||||
this.setData({}, function () {
|
||||
_this2.setLine();
|
||||
_this3.setLine();
|
||||
|
||||
_this2.scrollIntoView();
|
||||
_this3.setTrack();
|
||||
|
||||
_this3.scrollIntoView();
|
||||
});
|
||||
},
|
||||
// scroll active tab into view
|
||||
scrollIntoView: function scrollIntoView() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
if (!this.data.scrollable) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.getRect('.van-tab', true).then(function (tabRects) {
|
||||
var tabRect = tabRects[_this3.data.active];
|
||||
var offsetLeft = tabRects.slice(0, _this3.data.active).reduce(function (prev, curr) {
|
||||
var tabRect = tabRects[_this4.data.active];
|
||||
var offsetLeft = tabRects.slice(0, _this4.data.active).reduce(function (prev, curr) {
|
||||
return prev + curr.width;
|
||||
}, 0);
|
||||
var tabWidth = tabRect.width;
|
||||
|
||||
_this3.getRect('.van-tabs__nav').then(function (navRect) {
|
||||
_this4.getRect('.van-tabs__nav').then(function (navRect) {
|
||||
var navWidth = navRect.width;
|
||||
|
||||
_this3.setData({
|
||||
_this4.setData({
|
||||
scrollLeft: offsetLeft - (navWidth - tabWidth) / 2
|
||||
});
|
||||
});
|
||||
|
6
dist/tabs/index.wxml
vendored
6
dist/tabs/index.wxml
vendored
@ -22,5 +22,9 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<slot />
|
||||
<view class="van-tabs__content">
|
||||
<view class="van-tabs__track" style="{{ trackStyle }}">
|
||||
<slot />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
2
dist/tabs/index.wxss
vendored
2
dist/tabs/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab span{display:block}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9}
|
||||
@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab span{display:block}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9}
|
2
dist/tag/index.js
vendored
2
dist/tag/index.js
vendored
@ -18,7 +18,7 @@ VantComponent({
|
||||
computed: {
|
||||
classes: function classes() {
|
||||
var data = this.data;
|
||||
return this.classNames('van-tag', 'custom-class', {
|
||||
return this.classNames('van-tag', {
|
||||
'van-tag--mark': data.mark,
|
||||
'van-tag--plain': data.plain,
|
||||
'van-tag--round': data.round,
|
||||
|
5
dist/tag/index.wxml
vendored
5
dist/tag/index.wxml
vendored
@ -1,3 +1,6 @@
|
||||
<view class="{{ classes }}" style="{{ style }}">
|
||||
<view
|
||||
class="custom-class {{ classes }}"
|
||||
style="{{ style }}"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
|
2
dist/toast/index.wxss
vendored
2
dist/toast/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:14px;line-height:20px;border-radius:4px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;background-color:rgba(0,0,0,.7)}.van-toast__container{top:50%;left:50%;max-width:80%;position:fixed;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{min-width:120px;padding:8px 12px}.van-toast--icon{width:120px;min-height:120px;padding:15px}.van-toast--icon .van-toast__icon{height:1em;font-size:50px}.van-toast--icon .van-toast__text{font-size:14px;padding-top:10px}.van-toast__loading{margin:10px 0 5px}.van-toast--top{-webkit-transform:translate(0,-30vh);transform:translate(0,-30vh)}.van-toast--bottom{-webkit-transform:translate(0,30vh);transform:translate(0,30vh)}
|
||||
@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:14px;line-height:20px;border-radius:4px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center;box-sizing:content-box;background-color:rgba(0,0,0,.7)}.van-toast__container{position:fixed;top:50%;left:50%;max-width:70%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{padding:8px 12px;min-width:96px}.van-toast--icon{width:90px;padding:15px;min-height:90px}.van-toast--icon .van-toast__icon{font-size:50px}.van-toast--icon .van-toast__text{padding-top:5px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translate(0,-30vh);transform:translate(0,-30vh)}.van-toast--bottom{-webkit-transform:translate(0,30vh);transform:translate(0,30vh)}
|
Loading…
x
Reference in New Issue
Block a user