first commit
This commit is contained in:
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/props.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/props.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../libs/config/props.js"),o={props:{src:{type:String,default:()=>e.defProps.image.src},mode:{type:String,default:()=>e.defProps.image.mode},width:{type:[String,Number],default:()=>e.defProps.image.width},height:{type:[String,Number],default:()=>e.defProps.image.height},shape:{type:String,default:()=>e.defProps.image.shape},radius:{type:[String,Number],default:()=>e.defProps.image.radius},lazyLoad:{type:Boolean,default:()=>e.defProps.image.lazyLoad},showMenuByLongpress:{type:Boolean,default:()=>e.defProps.image.showMenuByLongpress},loadingIcon:{type:String,default:()=>e.defProps.image.loadingIcon},errorIcon:{type:String,default:()=>e.defProps.image.errorIcon},showLoading:{type:Boolean,default:()=>e.defProps.image.showLoading},showError:{type:Boolean,default:()=>e.defProps.image.showError},fade:{type:Boolean,default:()=>e.defProps.image.fade},webp:{type:Boolean,default:()=>e.defProps.image.webp},duration:{type:[String,Number],default:()=>e.defProps.image.duration},bgColor:{type:String,default:()=>e.defProps.image.bgColor}}};exports.props=o;
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const i=require("./props.js"),r=require("../../libs/mixin/mpMixin.js"),o=require("../../libs/mixin/mixin.js"),t=require("../../libs/function/index.js"),e=require("../../../../common/vendor.js"),d={name:"u-image",mixins:[r.mpMixin,o.mixin,i.props],data(){return{isError:!1,loading:!0,opacity:1,durationTime:this.duration,backgroundStyle:{},show:!1}},watch:{src:{immediate:!0,handler(i){i?(this.isError=!1,this.loading=!0):this.isError=!0}}},computed:{wrapStyle(){let i={};return i.width=t.addUnit(this.width),i.height=t.addUnit(this.height),i.borderRadius="circle"==this.shape?"10000px":t.addUnit(this.radius),i.overflow=this.radius>0?"hidden":"visible",t.deepMerge(i,t.addStyle(this.customStyle))}},mounted(){this.show=!0},emits:["click","error","load"],methods:{addUnit:t.addUnit,onClick(){this.$emit("click")},onErrorHandler(i){this.loading=!1,this.isError=!0,this.$emit("error",i)},onLoadHandler(i){this.loading=!1,this.isError=!1,this.$emit("load",i),this.removeBgColor()},removeBgColor(){this.backgroundStyle={backgroundColor:"transparent"}}}};if(!Array){(e.resolveComponent("u-icon")+e.resolveComponent("u-transition"))()}Math||((()=>"../u-icon/u-icon.js")+(()=>"../u-transition/u-transition.js"))();const n=e._export_sfc(d,[["render",function(i,r,o,t,d,n){return e.e({a:!d.isError},d.isError?{}:{b:i.src,c:i.mode,d:e.o(((...i)=>n.onErrorHandler&&n.onErrorHandler(...i))),e:e.o(((...i)=>n.onLoadHandler&&n.onLoadHandler(...i))),f:i.showMenuByLongpress,g:i.lazyLoad,h:"circle"==i.shape?"10000px":n.addUnit(i.radius),i:n.addUnit(i.width),j:n.addUnit(i.height)},{k:i.showLoading&&d.loading},i.showLoading&&d.loading?{l:e.p({name:i.loadingIcon,width:i.width,height:i.height}),m:"circle"==i.shape?"50%":n.addUnit(i.radius),n:this.bgColor,o:n.addUnit(i.width),p:n.addUnit(i.height)}:{},{q:i.showError&&d.isError&&!d.loading},i.showError&&d.isError&&!d.loading?{r:e.p({name:i.errorIcon,width:i.width,height:i.height}),s:"circle"==i.shape?"50%":n.addUnit(i.radius),t:n.addUnit(i.width),v:n.addUnit(i.height)}:{},{w:e.o(((...i)=>n.onClick&&n.onClick(...i))),x:e.s(n.wrapStyle),y:e.s(d.backgroundStyle),z:e.p({mode:"fade",show:d.show,duration:i.fade?1e3:0})})}],["__scopeId","data-v-ff1f9d02"]]);wx.createComponent(n);
|
||||
7
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.json
vendored
Normal file
7
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-icon": "../u-icon/u-icon",
|
||||
"u-transition": "../u-transition/u-transition"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.wxml
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<u-transition wx:if="{{z}}" class="data-v-ff1f9d02" u-s="{{['d']}}" u-i="ff1f9d02-0" bind:__l="__l" u-p="{{z}}"><view class="u-image data-v-ff1f9d02" bindtap="{{w}}" style="{{x + ';' + y}}"><image wx:if="{{a}}" src="{{b}}" mode="{{c}}" binderror="{{d}}" bindload="{{e}}" show-menu-by-longpress="{{f}}" lazy-load="{{g}}" class="u-image__image data-v-ff1f9d02" style="{{'border-radius:' + h + ';' + ('width:' + i) + ';' + ('height:' + j)}}"></image><view wx:if="{{k}}" class="u-image__loading data-v-ff1f9d02" style="{{'border-radius:' + m + ';' + ('background-color:' + n) + ';' + ('width:' + o) + ';' + ('height:' + p)}}"><block wx:if="{{$slots.loading}}"><slot name="loading"></slot></block><block wx:else><u-icon wx:if="{{l}}" class="data-v-ff1f9d02" u-i="ff1f9d02-1,ff1f9d02-0" bind:__l="__l" u-p="{{l}}"></u-icon></block></view><view wx:if="{{q}}" class="u-image__error data-v-ff1f9d02" style="{{'border-radius:' + s + ';' + ('width:' + t) + ';' + ('height:' + v)}}"><block wx:if="{{$slots.error}}"><slot name="error"></slot></block><block wx:else><u-icon wx:if="{{r}}" class="data-v-ff1f9d02" u-i="ff1f9d02-2,ff1f9d02-0" bind:__l="__l" u-p="{{r}}"></u-icon></block></view></view></u-transition>
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.wxss
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/components/u-image/u-image.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.u-empty.data-v-ff1f9d02,.u-empty__wrap.data-v-ff1f9d02,.u-tabs.data-v-ff1f9d02,.u-tabs__wrapper.data-v-ff1f9d02,.u-tabs__wrapper__scroll-view-wrapper.data-v-ff1f9d02,.u-tabs__wrapper__scroll-view.data-v-ff1f9d02,.u-tabs__wrapper__nav.data-v-ff1f9d02,.u-tabs__wrapper__nav__line.data-v-ff1f9d02{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.u-image.data-v-ff1f9d02{position:relative;transition:opacity .5s ease-in-out}.u-image__image.data-v-ff1f9d02{width:100%;height:100%}.u-image__loading.data-v-ff1f9d02,.u-image__error.data-v-ff1f9d02{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:#f3f4f6;color:#909193;font-size:46rpx}
|
||||
Reference in New Issue
Block a user