File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
web/src/js/view/newhome/module/workspace Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 78
78
position : relative ;
79
79
background : url (" ../../images/workspace.png" ) center center no-repeat ;
80
80
background-size : cover ;
81
- min- width : 222px ;
81
+ width : 222px ;
82
82
.name {
83
83
display : block ;
84
84
font-size : 16px ;
Original file line number Diff line number Diff line change @@ -162,8 +162,7 @@ export default {
162
162
videosClick: 1 ,
163
163
videosMaxClick: null ,
164
164
listWrap: 0 ,// 屏幕宽度
165
- workspaceItemWidth: 0 , // workspaceItem 宽度
166
- workspaceItemMargin: 30
165
+ workspaceItemWidth: 252 , // workspaceItem 宽度
167
166
}
168
167
},
169
168
created () {
@@ -184,8 +183,7 @@ export default {
184
183
},
185
184
watch: {
186
185
' listWrap ' : function (val ){ // 监听容器宽度变化
187
- this .listWrap = val;
188
- this .pageSize = Math .floor (this .listWrap / this .workspaceItemWidth )
186
+ this .pageSize = Math .floor (val / this .workspaceItemWidth )
189
187
this .initWorkspace ();
190
188
},
191
189
},
@@ -195,12 +193,8 @@ export default {
195
193
this .loading = true ;
196
194
api .fetch (' dss/workspaces' , {}, ' get' ).then ((res ) => {
197
195
this .originWorkspaceData = this .filteredData = this .cacheData = res .workspaces ;
198
- this .$nextTick (() => {
199
- this .workspaceItemWidth = this .$refs .col [0 ] && this .$refs .col [0 ].$el .offsetWidth ;
200
- this .pageSize = Math .floor (this .listWrap / (this .workspaceItemWidth + this .workspaceItemMargin ))
201
- this .initWorkspace ();
202
- this .loading = false ;
203
- })
196
+ this .initWorkspace ();
197
+ this .loading = false ;
204
198
}).catch (() => {
205
199
this .loading = false ;
206
200
});
You can’t perform that action at this time.
0 commit comments