mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
build: compile 1.9.1
This commit is contained in:
parent
71e2e11fde
commit
9fafff0dc4
4
dist/calendar/index.js
vendored
4
dist/calendar/index.js
vendored
@ -106,6 +106,7 @@ VantComponent({
|
|||||||
type: Number,
|
type: Number,
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
|
readonly: Boolean,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
subtitle: '',
|
subtitle: '',
|
||||||
@ -211,6 +212,9 @@ VantComponent({
|
|||||||
this.$emit('closed');
|
this.$emit('closed');
|
||||||
},
|
},
|
||||||
onClickDay(event) {
|
onClickDay(event) {
|
||||||
|
if (this.data.readonly) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { date } = event.detail;
|
const { date } = event.detail;
|
||||||
const { type, currentDate, allowSameDay } = this.data;
|
const { type, currentDate, allowSameDay } = this.data;
|
||||||
if (type === 'range') {
|
if (type === 'range') {
|
||||||
|
7
dist/slider/index.js
vendored
7
dist/slider/index.js
vendored
@ -93,9 +93,10 @@ VantComponent({
|
|||||||
const { min } = this.data;
|
const { min } = this.data;
|
||||||
getRect(this, '.van-slider').then((rect) => {
|
getRect(this, '.van-slider').then((rect) => {
|
||||||
const { vertical } = this.data;
|
const { vertical } = this.data;
|
||||||
|
const touch = event.touches[0];
|
||||||
const delta = vertical
|
const delta = vertical
|
||||||
? event.detail.y - rect.top
|
? touch.clientY - rect.top
|
||||||
: event.detail.x - rect.left;
|
: touch.clientX - rect.left;
|
||||||
const total = vertical ? rect.height : rect.width;
|
const total = vertical ? rect.height : rect.width;
|
||||||
const value = Number(min) + (delta / total) * this.getRange();
|
const value = Number(min) + (delta / total) * this.getRange();
|
||||||
if (this.isRange(this.value)) {
|
if (this.isRange(this.value)) {
|
||||||
@ -136,7 +137,7 @@ VantComponent({
|
|||||||
this.setData({
|
this.setData({
|
||||||
wrapperStyle: `
|
wrapperStyle: `
|
||||||
background: ${this.data.inactiveColor || ''};
|
background: ${this.data.inactiveColor || ''};
|
||||||
${mainAxis}: ${addUnit(this.data.barHeight) || ''};
|
${vertical ? 'width' : 'height'}: ${addUnit(this.data.barHeight) || ''};
|
||||||
`,
|
`,
|
||||||
barStyle: `
|
barStyle: `
|
||||||
${mainAxis}: ${this.calcMainAxis()};
|
${mainAxis}: ${this.calcMainAxis()};
|
||||||
|
@ -120,6 +120,7 @@ var initialMaxDate = (function () {
|
|||||||
type: Number,
|
type: Number,
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
|
readonly: Boolean,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
subtitle: '',
|
subtitle: '',
|
||||||
@ -231,6 +232,9 @@ var initialMaxDate = (function () {
|
|||||||
this.$emit('closed');
|
this.$emit('closed');
|
||||||
},
|
},
|
||||||
onClickDay: function (event) {
|
onClickDay: function (event) {
|
||||||
|
if (this.data.readonly) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var date = event.detail.date;
|
var date = event.detail.date;
|
||||||
var _a = this.data, type = _a.type, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay;
|
var _a = this.data, type = _a.type, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay;
|
||||||
if (type === 'range') {
|
if (type === 'range') {
|
||||||
|
@ -98,9 +98,10 @@ var utils_1 = require("../common/utils");
|
|||||||
var min = this.data.min;
|
var min = this.data.min;
|
||||||
(0, utils_1.getRect)(this, '.van-slider').then(function (rect) {
|
(0, utils_1.getRect)(this, '.van-slider').then(function (rect) {
|
||||||
var vertical = _this.data.vertical;
|
var vertical = _this.data.vertical;
|
||||||
|
var touch = event.touches[0];
|
||||||
var delta = vertical
|
var delta = vertical
|
||||||
? event.detail.y - rect.top
|
? touch.clientY - rect.top
|
||||||
: event.detail.x - rect.left;
|
: touch.clientX - rect.left;
|
||||||
var total = vertical ? rect.height : rect.width;
|
var total = vertical ? rect.height : rect.width;
|
||||||
var value = Number(min) + (delta / total) * _this.getRange();
|
var value = Number(min) + (delta / total) * _this.getRange();
|
||||||
if (_this.isRange(_this.value)) {
|
if (_this.isRange(_this.value)) {
|
||||||
@ -140,7 +141,7 @@ var utils_1 = require("../common/utils");
|
|||||||
var vertical = this.data.vertical;
|
var vertical = this.data.vertical;
|
||||||
var mainAxis = vertical ? 'height' : 'width';
|
var mainAxis = vertical ? 'height' : 'width';
|
||||||
this.setData({
|
this.setData({
|
||||||
wrapperStyle: "\n background: " + (this.data.inactiveColor || '') + ";\n " + mainAxis + ": " + ((0, utils_1.addUnit)(this.data.barHeight) || '') + ";\n ",
|
wrapperStyle: "\n background: " + (this.data.inactiveColor || '') + ";\n " + (vertical ? 'width' : 'height') + ": " + ((0, utils_1.addUnit)(this.data.barHeight) || '') + ";\n ",
|
||||||
barStyle: "\n " + mainAxis + ": " + this.calcMainAxis() + ";\n left: " + (vertical ? 0 : this.calcOffset()) + ";\n top: " + (vertical ? this.calcOffset() : 0) + ";\n " + (drag ? 'transition: none;' : '') + "\n ",
|
barStyle: "\n " + mainAxis + ": " + this.calcMainAxis() + ";\n left: " + (vertical ? 0 : this.calcOffset()) + ";\n top: " + (vertical ? this.calcOffset() : 0) + ";\n " + (drag ? 'transition: none;' : '') + "\n ",
|
||||||
});
|
});
|
||||||
if (drag) {
|
if (drag) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user