微信小程序联调
This commit is contained in:
1
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const t=require("../../../../common/vendor.js"),e={name:"UniBadge",emits:["click"],props:{type:{type:String,default:"error"},inverted:{type:Boolean,default:!1},isDot:{type:Boolean,default:!1},maxNum:{type:Number,default:99},absolute:{type:String,default:""},offset:{type:Array,default:()=>[0,0]},text:{type:[String,Number],default:""},size:{type:String,default:"small"},customStyle:{type:Object,default:()=>({})}},data:()=>({}),computed:{width(){return 8*String(this.text).length+12},classNames(){const{inverted:t,type:e,size:i,absolute:o}=this;return[t?"uni-badge--"+e+"-inverted":"","uni-badge--"+e,"uni-badge--"+i,o?"uni-badge--absolute":""].join(" ")},positionStyle(){if(!this.absolute)return{};let t=this.width/2,e=10;this.isDot&&(t=5,e=5);const i=`${-t+this.offset[0]}px`,o=`${-e+this.offset[1]}px`,s={rightTop:{right:i,top:o},rightBottom:{right:i,bottom:o},leftBottom:{left:i,bottom:o},leftTop:{left:i,top:o}},r=s[this.absolute];return r||s.rightTop},dotStyle(){return this.isDot?{width:"10px",minWidth:"0",height:"10px",padding:"0",borderRadius:"10px"}:{}},displayValue(){const{isDot:t,text:e,maxNum:i}=this;return t?"":Number(e)>i?`${i}+`:e}},methods:{onClick(){this.$emit("click")}}};const i=t._export_sfc(e,[["render",function(e,i,o,s,r,n){return t.e({a:o.text},o.text?{b:t.t(n.displayValue),c:t.n(n.classNames),d:t.s(n.positionStyle),e:t.s(o.customStyle),f:t.s(n.dotStyle),g:t.o((t=>n.onClick()),"18")}:{})}]]);wx.createComponent(i);
|
||||
4
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.json
vendored
Normal file
4
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.wxml
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="uni-badge--x"><slot/><text wx:if="{{a}}" class="{{[c, 'uni-badge']}}" style="{{d + ';' + e + ';' + f}}" bindtap="{{g}}">{{b}}</text></view>
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.wxss
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.uni-badge--x{display:inline-block;position:relative}.uni-badge--absolute{position:absolute}.uni-badge--small{transform:scale(.8);transform-origin:center center}.uni-badge{display:flex;overflow:hidden;box-sizing:border-box;font-feature-settings:"tnum";min-width:20px;justify-content:center;flex-direction:row;height:20px;padding:0 4px;line-height:18px;color:#fff;border-radius:100px;background-color:#909399;background-color:transparent;border:1px solid #fff;text-align:center;font-family:Helvetica Neue,Helvetica,sans-serif;font-size:12px}.uni-badge--info{color:#fff;background-color:#909399}.uni-badge--primary{background-color:#2979ff}.uni-badge--success{background-color:#4cd964}.uni-badge--warning{background-color:#f0ad4e}.uni-badge--error{background-color:#dd524d}.uni-badge--inverted{padding:0 5px 0 0;color:#909399}.uni-badge--info-inverted{color:#909399;background-color:transparent}.uni-badge--primary-inverted{color:#2979ff;background-color:transparent}.uni-badge--success-inverted{color:#4cd964;background-color:transparent}.uni-badge--warning-inverted{color:#f0ad4e;background-color:transparent}.uni-badge--error-inverted{color:#dd524d;background-color:transparent}
|
||||
Reference in New Issue
Block a user