mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +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 }) {
|
||||
console.info('[zan:actionsheet:cancel]');
|
||||
|
||||
if (this.handleZanActionsheetCancel) {
|
||||
this.handleZanActionsheetCancel({ componentId });
|
||||
} else {
|
||||
|
10
dist/capsule/index.wxml
vendored
10
dist/capsule/index.wxml
vendored
@ -1,8 +1,14 @@
|
||||
<template name="capsule">
|
||||
<view class="zan-capsule zan-capsule--{{type}}">
|
||||
<block wx:if="{{color}}">
|
||||
<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>
|
||||
<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 wx:else>
|
||||
<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);
|
||||
event.componentId = componentId;
|
||||
|
||||
console.info('[zan:field:change]', event);
|
||||
|
||||
|
||||
if (this.handleZanFieldChange) {
|
||||
return this.handleZanFieldChange(event);
|
||||
@ -18,25 +18,21 @@ module.exports = {
|
||||
const componentId = extractComponentId(event);
|
||||
event.componentId = componentId;
|
||||
|
||||
console.info('[zan:field:focus]', event);
|
||||
|
||||
|
||||
if (this.handleZanFieldFocus) {
|
||||
return this.handleZanFieldFocus(event);
|
||||
}
|
||||
|
||||
console.warn('页面缺少 handleZanFieldFocus 回调函数');
|
||||
},
|
||||
|
||||
_handleZanFieldBlur(event) {
|
||||
const componentId = extractComponentId(event);
|
||||
event.componentId = componentId;
|
||||
|
||||
console.info('[zan:field:blur]', event);
|
||||
|
||||
|
||||
if (this.handleZanFieldBlur) {
|
||||
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) {
|
||||
const e = { componentId, value };
|
||||
console.info('[zan:Select:change]', e);
|
||||
|
||||
|
||||
if (this.handleZanSelectChange) {
|
||||
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) {
|
||||
stepper = +stepper;
|
||||
var e = { componentId, stepper };
|
||||
console.info('[zan:stepper:change]', e);
|
||||
|
||||
|
||||
if (this.handleZanStepperChange) {
|
||||
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;
|
||||
|
||||
console.info('[zan:switch:change]', { checked, componentId });
|
||||
|
||||
|
||||
if (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 data = { componentId, selectedId };
|
||||
|
||||
console.info('[zan:tab:change]', data);
|
||||
|
||||
if (this.handleZanTabChange) {
|
||||
this.handleZanTabChange(data);
|
||||
} 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": {
|
||||
"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",
|
||||
"icon": "sh scripts/build-icon.sh",
|
||||
"dev": "node scripts/build-dev.js --color",
|
||||
@ -29,10 +29,12 @@
|
||||
],
|
||||
"homepage": "https://github.com/youzan/zanui-weapp#readme",
|
||||
"devDependencies": {
|
||||
"cross-env": "^5.1.4",
|
||||
"fs-extra": "^4.0.2",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-clean-css": "^3.9.0",
|
||||
"gulp-postcss": "^7.0.0",
|
||||
"gulp-remove-logging": "^1.2.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-util": "^3.0.8",
|
||||
"node-watch": "^0.5.5",
|
||||
|
@ -1,8 +1,14 @@
|
||||
<template name="capsule">
|
||||
<view class="zan-capsule zan-capsule--{{type}}">
|
||||
<block wx:if="{{color}}">
|
||||
<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>
|
||||
<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 wx:else>
|
||||
<view class="zan-capsule__left">{{ leftText }}</view>
|
||||
|
@ -23,8 +23,6 @@ module.exports = {
|
||||
if (this.handleZanFieldFocus) {
|
||||
return this.handleZanFieldFocus(event);
|
||||
}
|
||||
|
||||
console.warn('页面缺少 handleZanFieldFocus 回调函数');
|
||||
},
|
||||
|
||||
_handleZanFieldBlur(event) {
|
||||
@ -36,7 +34,5 @@ module.exports = {
|
||||
if (this.handleZanFieldBlur) {
|
||||
return this.handleZanFieldBlur(event);
|
||||
}
|
||||
|
||||
console.warn('页面缺少 handleZanFieldBlur 回调函数');
|
||||
}
|
||||
};
|
||||
|
@ -3,10 +3,12 @@ const postcss = require('gulp-postcss');
|
||||
const cssmin = require('gulp-clean-css');
|
||||
const rename = require('gulp-rename');
|
||||
const gutil = require('gulp-util');
|
||||
const removeLogging = require('gulp-remove-logging');
|
||||
|
||||
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'])
|
||||
.pipe(postcss())
|
||||
.pipe(cssmin())
|
||||
@ -16,4 +18,12 @@ gulp.task('compile', () => {
|
||||
.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, {
|
||||
filter(src = '') {
|
||||
const extname = path.extname(src);
|
||||
return ['.pcss', '.md'].indexOf(extname) < 0;
|
||||
return ['.js', '.pcss', '.md'].indexOf(extname) < 0;
|
||||
}
|
||||
});
|
||||
|
||||
// js 无需编译,让微信开发者工具处理
|
||||
|
||||
// 编译 wxss 文件
|
||||
exec(`gulp build --gulpfile scripts/utils/build-css.js --dist ${config.dist} --color`);
|
||||
// 编译 js wxss 文件
|
||||
exec(`gulp build --gulpfile scripts/utils/build.js --dist ${config.dist} --color`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user