mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-10-05 08:19:58 +08:00
parent
878c0ae70a
commit
3d016db8b0
2
dist/actionsheet/index.js
vendored
2
dist/actionsheet/index.js
vendored
@ -32,7 +32,7 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function resolveCancelClick({ componentId }) {
|
function resolveCancelClick({ componentId }) {
|
||||||
console.info('[zan:actionsheet:cancel]');
|
|
||||||
if (this.handleZanActionsheetCancel) {
|
if (this.handleZanActionsheetCancel) {
|
||||||
this.handleZanActionsheetCancel({ componentId });
|
this.handleZanActionsheetCancel({ componentId });
|
||||||
} else {
|
} else {
|
||||||
|
10
dist/capsule/index.wxml
vendored
10
dist/capsule/index.wxml
vendored
@ -1,8 +1,14 @@
|
|||||||
<template name="capsule">
|
<template name="capsule">
|
||||||
<view class="zan-capsule zan-capsule--{{type}}">
|
<view class="zan-capsule zan-capsule--{{type}}">
|
||||||
<block wx:if="{{color}}">
|
<block wx:if="{{color}}">
|
||||||
<view class="zan-capsule__left" style="background: {{ color }}; border-color: {{ color }}">{{ leftText }}</view>
|
<view
|
||||||
<view class="zan-capsule__right" style="color: {{ color }}; border-color: {{ color }}">{{ rightText }}</view>
|
class="zan-capsule__left"
|
||||||
|
style="background: {{ color }}; border-color: {{ color }}"
|
||||||
|
>{{ leftText }}</view>
|
||||||
|
<view
|
||||||
|
class="zan-capsule__right"
|
||||||
|
style="color: {{ color }}; border-color: {{ color }}"
|
||||||
|
>{{ rightText }}</view>
|
||||||
</block>
|
</block>
|
||||||
<block wx:else>
|
<block wx:else>
|
||||||
<view class="zan-capsule__left">{{ leftText }}</view>
|
<view class="zan-capsule__left">{{ leftText }}</view>
|
||||||
|
10
dist/field/index.js
vendored
10
dist/field/index.js
vendored
@ -5,7 +5,7 @@ module.exports = {
|
|||||||
const componentId = extractComponentId(event);
|
const componentId = extractComponentId(event);
|
||||||
event.componentId = componentId;
|
event.componentId = componentId;
|
||||||
|
|
||||||
console.info('[zan:field:change]', event);
|
|
||||||
|
|
||||||
if (this.handleZanFieldChange) {
|
if (this.handleZanFieldChange) {
|
||||||
return this.handleZanFieldChange(event);
|
return this.handleZanFieldChange(event);
|
||||||
@ -18,25 +18,21 @@ module.exports = {
|
|||||||
const componentId = extractComponentId(event);
|
const componentId = extractComponentId(event);
|
||||||
event.componentId = componentId;
|
event.componentId = componentId;
|
||||||
|
|
||||||
console.info('[zan:field:focus]', event);
|
|
||||||
|
|
||||||
if (this.handleZanFieldFocus) {
|
if (this.handleZanFieldFocus) {
|
||||||
return this.handleZanFieldFocus(event);
|
return this.handleZanFieldFocus(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn('页面缺少 handleZanFieldFocus 回调函数');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleZanFieldBlur(event) {
|
_handleZanFieldBlur(event) {
|
||||||
const componentId = extractComponentId(event);
|
const componentId = extractComponentId(event);
|
||||||
event.componentId = componentId;
|
event.componentId = componentId;
|
||||||
|
|
||||||
console.info('[zan:field:blur]', event);
|
|
||||||
|
|
||||||
if (this.handleZanFieldBlur) {
|
if (this.handleZanFieldBlur) {
|
||||||
return this.handleZanFieldBlur(event);
|
return this.handleZanFieldBlur(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn('页面缺少 handleZanFieldBlur 回调函数');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
2
dist/select/index.js
vendored
2
dist/select/index.js
vendored
@ -9,7 +9,7 @@ function handle(e) {
|
|||||||
|
|
||||||
function callback(componentId, value) {
|
function callback(componentId, value) {
|
||||||
const e = { componentId, value };
|
const e = { componentId, value };
|
||||||
console.info('[zan:Select:change]', e);
|
|
||||||
|
|
||||||
if (this.handleZanSelectChange) {
|
if (this.handleZanSelectChange) {
|
||||||
this.handleZanSelectChange(e);
|
this.handleZanSelectChange(e);
|
||||||
|
2
dist/stepper/index.js
vendored
2
dist/stepper/index.js
vendored
@ -12,7 +12,7 @@ function handle(e, num) {
|
|||||||
function callback(componentId, stepper) {
|
function callback(componentId, stepper) {
|
||||||
stepper = +stepper;
|
stepper = +stepper;
|
||||||
var e = { componentId, stepper };
|
var e = { componentId, stepper };
|
||||||
console.info('[zan:stepper:change]', e);
|
|
||||||
|
|
||||||
if (this.handleZanStepperChange) {
|
if (this.handleZanStepperChange) {
|
||||||
this.handleZanStepperChange(e);
|
this.handleZanStepperChange(e);
|
||||||
|
2
dist/switch/index.js
vendored
2
dist/switch/index.js
vendored
@ -9,7 +9,7 @@ var Switch = {
|
|||||||
|
|
||||||
if (loading || disabled) return;
|
if (loading || disabled) return;
|
||||||
|
|
||||||
console.info('[zan:switch:change]', { checked, componentId });
|
|
||||||
|
|
||||||
if (this.handleZanSwitchChange) {
|
if (this.handleZanSwitchChange) {
|
||||||
this.handleZanSwitchChange({
|
this.handleZanSwitchChange({
|
||||||
|
2
dist/tab/index.js
vendored
2
dist/tab/index.js
vendored
@ -7,7 +7,7 @@ var Tab = {
|
|||||||
const selectedId = dataset.itemId;
|
const selectedId = dataset.itemId;
|
||||||
const data = { componentId, selectedId };
|
const data = { componentId, selectedId };
|
||||||
|
|
||||||
console.info('[zan:tab:change]', data);
|
|
||||||
if (this.handleZanTabChange) {
|
if (this.handleZanTabChange) {
|
||||||
this.handleZanTabChange(data);
|
this.handleZanTabChange(data);
|
||||||
} else {
|
} else {
|
||||||
|
3453
package-lock.json
generated
3453
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"release": "sh scripts/release.sh",
|
"release": "sh scripts/release.sh",
|
||||||
"components": "node scripts/build-components.js --color",
|
"components": "cross-env NODE_ENV=production node scripts/build-components.js --color",
|
||||||
"changelog": "sh scripts/build-changelog.sh",
|
"changelog": "sh scripts/build-changelog.sh",
|
||||||
"icon": "sh scripts/build-icon.sh",
|
"icon": "sh scripts/build-icon.sh",
|
||||||
"dev": "node scripts/build-dev.js --color",
|
"dev": "node scripts/build-dev.js --color",
|
||||||
@ -29,10 +29,12 @@
|
|||||||
],
|
],
|
||||||
"homepage": "https://github.com/youzan/zanui-weapp#readme",
|
"homepage": "https://github.com/youzan/zanui-weapp#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"cross-env": "^5.1.4",
|
||||||
"fs-extra": "^4.0.2",
|
"fs-extra": "^4.0.2",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-clean-css": "^3.9.0",
|
"gulp-clean-css": "^3.9.0",
|
||||||
"gulp-postcss": "^7.0.0",
|
"gulp-postcss": "^7.0.0",
|
||||||
|
"gulp-remove-logging": "^1.2.0",
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-util": "^3.0.8",
|
"gulp-util": "^3.0.8",
|
||||||
"node-watch": "^0.5.5",
|
"node-watch": "^0.5.5",
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
<template name="capsule">
|
<template name="capsule">
|
||||||
<view class="zan-capsule zan-capsule--{{type}}">
|
<view class="zan-capsule zan-capsule--{{type}}">
|
||||||
<block wx:if="{{color}}">
|
<block wx:if="{{color}}">
|
||||||
<view class="zan-capsule__left" style="background: {{ color }}; border-color: {{ color }}">{{ leftText }}</view>
|
<view
|
||||||
<view class="zan-capsule__right" style="color: {{ color }}; border-color: {{ color }}">{{ rightText }}</view>
|
class="zan-capsule__left"
|
||||||
|
style="background: {{ color }}; border-color: {{ color }}"
|
||||||
|
>{{ leftText }}</view>
|
||||||
|
<view
|
||||||
|
class="zan-capsule__right"
|
||||||
|
style="color: {{ color }}; border-color: {{ color }}"
|
||||||
|
>{{ rightText }}</view>
|
||||||
</block>
|
</block>
|
||||||
<block wx:else>
|
<block wx:else>
|
||||||
<view class="zan-capsule__left">{{ leftText }}</view>
|
<view class="zan-capsule__left">{{ leftText }}</view>
|
||||||
|
@ -23,8 +23,6 @@ module.exports = {
|
|||||||
if (this.handleZanFieldFocus) {
|
if (this.handleZanFieldFocus) {
|
||||||
return this.handleZanFieldFocus(event);
|
return this.handleZanFieldFocus(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn('页面缺少 handleZanFieldFocus 回调函数');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleZanFieldBlur(event) {
|
_handleZanFieldBlur(event) {
|
||||||
@ -36,7 +34,5 @@ module.exports = {
|
|||||||
if (this.handleZanFieldBlur) {
|
if (this.handleZanFieldBlur) {
|
||||||
return this.handleZanFieldBlur(event);
|
return this.handleZanFieldBlur(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn('页面缺少 handleZanFieldBlur 回调函数');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,10 +3,12 @@ const postcss = require('gulp-postcss');
|
|||||||
const cssmin = require('gulp-clean-css');
|
const cssmin = require('gulp-clean-css');
|
||||||
const rename = require('gulp-rename');
|
const rename = require('gulp-rename');
|
||||||
const gutil = require('gulp-util');
|
const gutil = require('gulp-util');
|
||||||
|
const removeLogging = require('gulp-remove-logging');
|
||||||
|
|
||||||
const options = gutil.env;
|
const options = gutil.env;
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
gulp.task('compile', () => {
|
gulp.task('compile-css', () => {
|
||||||
return gulp.src(['../../packages/**/*.pcss', '!../../packages/**/_*.pcss'])
|
return gulp.src(['../../packages/**/*.pcss', '!../../packages/**/_*.pcss'])
|
||||||
.pipe(postcss())
|
.pipe(postcss())
|
||||||
.pipe(cssmin())
|
.pipe(cssmin())
|
||||||
@ -16,4 +18,12 @@ gulp.task('compile', () => {
|
|||||||
.pipe(gulp.dest(options.dist));
|
.pipe(gulp.dest(options.dist));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build', ['compile']);
|
gulp.task('compile-js', () => {
|
||||||
|
return gulp.src(['../../packages/**/*.js'])
|
||||||
|
.pipe(removeLogging({
|
||||||
|
methods: isProduction ? ['log', 'info'] : []
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(options.dist));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build', ['compile-css', 'compile-js']);
|
@ -20,12 +20,10 @@ function extracter(config = {}) {
|
|||||||
fs.copySync(config.src, config.dist, {
|
fs.copySync(config.src, config.dist, {
|
||||||
filter(src = '') {
|
filter(src = '') {
|
||||||
const extname = path.extname(src);
|
const extname = path.extname(src);
|
||||||
return ['.pcss', '.md'].indexOf(extname) < 0;
|
return ['.js', '.pcss', '.md'].indexOf(extname) < 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// js 无需编译,让微信开发者工具处理
|
// 编译 js wxss 文件
|
||||||
|
exec(`gulp build --gulpfile scripts/utils/build.js --dist ${config.dist} --color`);
|
||||||
// 编译 wxss 文件
|
|
||||||
exec(`gulp build --gulpfile scripts/utils/build-css.js --dist ${config.dist} --color`);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user