微信小程序联调
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"use strict";const i=require("../../../../common/vendor.js"),r={name:"UniGridItem",inject:["grid"],props:{index:{type:Number,default:0}},data:()=>({column:0,showBorder:!0,square:!0,highlight:!0,left:0,top:0,openNum:2,width:0,borderColor:"#e5e5e5"}),created(){this.column=this.grid.column,this.showBorder=this.grid.showBorder,this.square=this.grid.square,this.highlight=this.grid.highlight,this.top=0===this.hor?this.grid.hor:this.hor,this.left=0===this.ver?this.grid.ver:this.ver,this.borderColor=this.grid.borderColor,this.grid.children.push(this),this.width=this.grid.width},beforeDestroy(){this.grid.children.forEach(((i,r)=>{i===this&&this.grid.children.splice(r,1)}))},methods:{_onClick(){this.grid.change({detail:{index:this.index}})}}};const h=i._export_sfc(r,[["render",function(r,h,t,e,o,d){return i.e({a:o.width},o.width?{b:o.showBorder?1:"",c:o.showBorder&&t.index<o.column?1:"",d:o.highlight?1:"",e:o.borderColor,f:o.borderColor,g:o.borderColor,h:i.o(((...i)=>d._onClick&&d._onClick(...i)),"80"),i:i.s("width:"+o.width+";"+(o.square?"height:"+o.width:""))}:{})}],["__scopeId","data-v-2511947d"]]);wx.createComponent(h);
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" style="{{i}}" class="uni-grid-item data-v-2511947d"><view class="{{[b && 'uni-grid-item--border', c && 'uni-grid-item--border-top', d && 'uni-highlight', 'uni-grid-item__box', 'data-v-2511947d']}}" style="{{'border-right-color:' + e + ';' + ('border-bottom-color:' + f) + ';' + ('border-top-color:' + g)}}" bindtap="{{h}}"><slot/></view></view>
|
||||
@@ -0,0 +1 @@
|
||||
.uni-grid-item.data-v-2511947d{height:100%;display:flex}.uni-grid-item__box.data-v-2511947d{display:flex;width:100%;position:relative;flex:1;flex-direction:column}.uni-grid-item--border.data-v-2511947d{position:relative;z-index:0;border-bottom:1px #D2D2D2 solid;border-right:1px #D2D2D2 solid}.uni-grid-item--border-top.data-v-2511947d{position:relative;border-top:1px #D2D2D2 solid;z-index:0}.uni-highlight.data-v-2511947d:active{background-color:#f1f1f1}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js"),t={name:"UniGrid",emits:["change"],props:{column:{type:Number,default:3},showBorder:{type:Boolean,default:!0},borderColor:{type:String,default:"#D2D2D2"},square:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0}},provide(){return{grid:this}},data:()=>({elId:`Uni_${Math.ceil(1e6*Math.random()).toString(36)}`,width:0}),created(){this.children=[]},mounted(){this.$nextTick((()=>{this.init()}))},methods:{init(){setTimeout((()=>{this._getSize((e=>{this.children.forEach(((t,i)=>{t.width=e}))}))}),50)},change(e){this.$emit("change",e)},_getSize(t){e.index.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((e=>{this.width=parseInt((e[0].width-1)/this.column)+"px",t(this.width)}))}}};const i=e._export_sfc(t,[["render",function(e,t,i,r,o,n){return{a:o.elId,b:i.showBorder?1:"",c:i.borderColor}}],["__scopeId","data-v-a6acbddc"]]);wx.createComponent(i);
|
||||
4
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.json
vendored
Normal file
4
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.wxml
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="uni-grid-wrap data-v-a6acbddc"><view id="{{a}}" ref="uni-grid" class="{{['uni-grid', 'data-v-a6acbddc', b && 'uni-grid--border']}}" style="{{'border-left-color:' + c}}"><slot/></view></view>
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.wxss
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uni-grid/components/uni-grid/uni-grid.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.uni-grid-wrap.data-v-a6acbddc{display:flex;flex:1;flex-direction:column}.uni-grid.data-v-a6acbddc{display:flex;flex-direction:row;flex-wrap:wrap}.uni-grid--border.data-v-a6acbddc{position:relative;z-index:1;border-left:1px #D2D2D2 solid}
|
||||
Reference in New Issue
Block a user