mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[build] optimize build:lib script (#526)
This commit is contained in:
parent
c176dee9a2
commit
8246ce24e3
57
dist/behaviors/button.js
vendored
57
dist/behaviors/button.js
vendored
@ -1,57 +0,0 @@
|
|||||||
export default Behavior({
|
|
||||||
properties: {
|
|
||||||
loading: Boolean,
|
|
||||||
// 在自定义组件中,无法与外界的 form 组件联动,暂时不开放
|
|
||||||
// formType: String,
|
|
||||||
openType: String,
|
|
||||||
appParameter: String,
|
|
||||||
// 暂时不开放,直接传入无法设置样式
|
|
||||||
// hoverClass: {
|
|
||||||
// type: String,
|
|
||||||
// value: 'button-hover'
|
|
||||||
// },
|
|
||||||
hoverStopPropagation: Boolean,
|
|
||||||
hoverStartTime: {
|
|
||||||
type: Number,
|
|
||||||
value: 20
|
|
||||||
},
|
|
||||||
hoverStayTime: {
|
|
||||||
type: Number,
|
|
||||||
value: 70
|
|
||||||
},
|
|
||||||
lang: {
|
|
||||||
type: String,
|
|
||||||
value: 'en'
|
|
||||||
},
|
|
||||||
sessionFrom: {
|
|
||||||
type: String,
|
|
||||||
value: ''
|
|
||||||
},
|
|
||||||
sendMessageTitle: String,
|
|
||||||
sendMessagePath: String,
|
|
||||||
sendMessageImg: String,
|
|
||||||
showMessageCard: String
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
bindgetuserinfo(event = {}) {
|
|
||||||
this.triggerEvent('getuserinfo', event.detail || {});
|
|
||||||
},
|
|
||||||
|
|
||||||
bindcontact(event = {}) {
|
|
||||||
this.triggerEvent('contact', event.detail || {});
|
|
||||||
},
|
|
||||||
|
|
||||||
bindgetphonenumber(event = {}) {
|
|
||||||
this.triggerEvent('getphonenumber', event.detail || {});
|
|
||||||
},
|
|
||||||
|
|
||||||
bindopensetting(event = {}) {
|
|
||||||
this.triggerEvent('opensetting', event.detail || {});
|
|
||||||
},
|
|
||||||
|
|
||||||
binderror(event = {}) {
|
|
||||||
this.triggerEvent('error', event.detail || {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
22
dist/behaviors/touch.js
vendored
22
dist/behaviors/touch.js
vendored
@ -1,22 +0,0 @@
|
|||||||
export default Behavior({
|
|
||||||
methods: {
|
|
||||||
touchStart(event) {
|
|
||||||
this.direction = '';
|
|
||||||
this.deltaX = 0;
|
|
||||||
this.deltaY = 0;
|
|
||||||
this.offsetX = 0;
|
|
||||||
this.offsetY = 0;
|
|
||||||
this.startX = event.touches[0].clientX;
|
|
||||||
this.startY = event.touches[0].clientY;
|
|
||||||
},
|
|
||||||
|
|
||||||
touchMove(event) {
|
|
||||||
const touch = event.touches[0];
|
|
||||||
this.deltaX = touch.clientX - this.startX;
|
|
||||||
this.deltaY = touch.clientY - this.startY;
|
|
||||||
this.offsetX = Math.abs(this.deltaX);
|
|
||||||
this.offsetY = Math.abs(this.deltaY);
|
|
||||||
this.direction = this.offsetX > this.offsetY ? 'horizontal' : this.offsetX < this.offsetY ? 'vertical' : '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
54
dist/behaviors/transition.js
vendored
54
dist/behaviors/transition.js
vendored
@ -1,54 +0,0 @@
|
|||||||
export default function(showDefaultValue) {
|
|
||||||
return Behavior({
|
|
||||||
properties: {
|
|
||||||
customStyle: String,
|
|
||||||
show: {
|
|
||||||
value: showDefaultValue,
|
|
||||||
type: Boolean,
|
|
||||||
observer(value) {
|
|
||||||
if (value) {
|
|
||||||
this.show();
|
|
||||||
} else {
|
|
||||||
this.setData({
|
|
||||||
type: 'leave'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
duration: {
|
|
||||||
type: Number,
|
|
||||||
value: 300
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
data: {
|
|
||||||
type: '',
|
|
||||||
inited: false,
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
|
|
||||||
attached() {
|
|
||||||
if (this.data.show) {
|
|
||||||
this.show();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
show() {
|
|
||||||
this.setData({
|
|
||||||
inited: true,
|
|
||||||
display: true,
|
|
||||||
type: 'enter'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onAnimationEnd() {
|
|
||||||
if (!this.data.show) {
|
|
||||||
this.setData({
|
|
||||||
display: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
29
dist/common/classnames.js
vendored
29
dist/common/classnames.js
vendored
@ -1,29 +0,0 @@
|
|||||||
const hasOwn = {}.hasOwnProperty;
|
|
||||||
|
|
||||||
export default function classNames() {
|
|
||||||
const classes = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < arguments.length; i++) {
|
|
||||||
const arg = arguments[i];
|
|
||||||
if (!arg) continue;
|
|
||||||
|
|
||||||
const argType = typeof arg;
|
|
||||||
|
|
||||||
if (argType === 'string' || argType === 'number') {
|
|
||||||
classes.push(arg);
|
|
||||||
} else if (Array.isArray(arg) && arg.length) {
|
|
||||||
const inner = classNames.apply(null, arg);
|
|
||||||
if (inner) {
|
|
||||||
classes.push(inner);
|
|
||||||
}
|
|
||||||
} else if (argType === 'object') {
|
|
||||||
for (const key in arg) {
|
|
||||||
if (hasOwn.call(arg, key) && arg[key]) {
|
|
||||||
classes.push(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return classes.join(' ');
|
|
||||||
};
|
|
1
dist/common/index.wxss
vendored
1
dist/common/index.wxss
vendored
@ -1 +0,0 @@
|
|||||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}
|
|
13
dist/utils/index.js
vendored
13
dist/utils/index.js
vendored
@ -1,13 +0,0 @@
|
|||||||
function isDef(value) {
|
|
||||||
return value !== undefined && value !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isObj(x) {
|
|
||||||
const type = typeof x;
|
|
||||||
return x !== null && (type === 'object' || type === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
isObj,
|
|
||||||
isDef
|
|
||||||
};
|
|
@ -9,7 +9,7 @@
|
|||||||
"dev": "node build/dev.js",
|
"dev": "node build/dev.js",
|
||||||
"lint": "eslint ./packages --ext .js",
|
"lint": "eslint ./packages --ext .js",
|
||||||
"release": "sh build/release.sh",
|
"release": "sh build/release.sh",
|
||||||
"build:lib": "NODE_ENV=production node build/compiler.js",
|
"build:lib": "rm -rf dist && NODE_ENV=production node build/compiler.js",
|
||||||
"build:site": "rm -rf docs/dist && cross-env NODE_ENV=production webpack --config build/webpack.doc.prd.js && gh-pages -d docs/dist",
|
"build:site": "rm -rf docs/dist && cross-env NODE_ENV=production webpack --config build/webpack.doc.prd.js && gh-pages -d docs/dist",
|
||||||
"build:changelog": "vant-doc changelog --tag v0.2.0 ./docs/markdown/changelog.generated.md"
|
"build:changelog": "vant-doc changelog --tag v0.2.0 ./docs/markdown/changelog.generated.md"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user