mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
微信登录版
This commit is contained in:
22
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.js
Normal file
22
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
component_1.VantComponent({
|
||||
props: {
|
||||
dot: Boolean,
|
||||
info: null,
|
||||
size: null,
|
||||
color: String,
|
||||
customStyle: String,
|
||||
classPrefix: {
|
||||
type: String,
|
||||
value: 'van-icon',
|
||||
},
|
||||
name: String,
|
||||
},
|
||||
methods: {
|
||||
onClick: function () {
|
||||
this.$emit('click');
|
||||
},
|
||||
},
|
||||
});
|
||||
6
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.json
Normal file
6
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-info": "../info/index"
|
||||
}
|
||||
}
|
||||
20
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.wxml
Normal file
20
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.wxml
Normal file
@@ -0,0 +1,20 @@
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<view
|
||||
class="{{ computed.rootClass({ classPrefix, name }) }}"
|
||||
style="{{ computed.rootStyle({ customStyle, color, size }) }}"
|
||||
bindtap="onClick"
|
||||
>
|
||||
<van-info
|
||||
wx:if="{{ info !== null || dot }}"
|
||||
dot="{{ dot }}"
|
||||
info="{{ info }}"
|
||||
custom-class="van-icon__info"
|
||||
/>
|
||||
<image
|
||||
wx:if="{{ computed.isImage(name) }}"
|
||||
src="{{ name }}"
|
||||
mode="aspectFit"
|
||||
class="van-icon__image"
|
||||
/>
|
||||
</view>
|
||||
39
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.wxs
Normal file
39
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.wxs
Normal file
@@ -0,0 +1,39 @@
|
||||
/* eslint-disable */
|
||||
var style = require('../wxs/style.wxs');
|
||||
var addUnit = require('../wxs/add-unit.wxs');
|
||||
|
||||
function isImage(name) {
|
||||
return name.indexOf('/') !== -1;
|
||||
}
|
||||
|
||||
function rootClass(data) {
|
||||
var classes = ['custom-class'];
|
||||
|
||||
if (data.classPrefix != null) {
|
||||
classes.push(data.classPrefix);
|
||||
}
|
||||
|
||||
if (isImage(data.name)) {
|
||||
classes.push('van-icon--image');
|
||||
} else if (data.classPrefix != null) {
|
||||
classes.push(data.classPrefix + '-' + data.name);
|
||||
}
|
||||
|
||||
return classes.join(' ');
|
||||
}
|
||||
|
||||
function rootStyle(data) {
|
||||
return style([
|
||||
{
|
||||
color: data.color,
|
||||
'font-size': addUnit(data.size),
|
||||
},
|
||||
data.customStyle,
|
||||
]);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isImage: isImage,
|
||||
rootClass: rootClass,
|
||||
rootStyle: rootStyle,
|
||||
};
|
||||
1
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.wxss
Normal file
1
wechat_v2/miniprogram_npm/@vant/weapp/icon/index.wxss
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user