Skip to content

Commit 94d965f

Browse files
authored
Merge pull request #197 from det101/master
screen adaptation
2 parents 594d8ad + d06ad02 commit 94d965f

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

web/src/js/module/header/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default {
209209
this.isNavMenuShow = false;
210210
},
211211
mouseover() {
212-
this.isNavMenuShow = this.$route.path != '/project'
212+
this.isNavMenuShow = (this.$route.path != '/project' && this.$route.path != '/newhome')
213213
},
214214
mouseleave() {
215215
this.isNavMenuShow = false

web/src/js/view/newhome/module/workspace/index.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
<h3 class="item-header">
4646
<span>{{ $t('message.workspace.workspaceList') }}</span>
4747
</h3>
48-
<Row class="content-item" v-show="visual === 'card'">
48+
<Row ref="row" class="content-item" v-show="visual === 'card'">
4949
<i-col
50+
ref="col"
5051
class="workspace-item"
5152
:xs="12" :sm="8" :md="4" :lg="4"
5253
v-for="item in originWorkspaceData"
@@ -158,13 +159,30 @@ export default {
158159
pageSize: 4,
159160
pageNum: 1,
160161
videosClick: 1,
161-
videosMaxClick: null
162+
videosMaxClick: null,
163+
listWrap: 0,//屏幕宽度
162164
}
163165
},
164166
created() {
165167
this.getWorkspaces();
166168
this.getVideos();
167169
},
170+
mounted(){
171+
this.listWrap = this.$refs.row.$el.offsetWidth;
172+
this.initWorkspace();
173+
window.onresize = () => {
174+
const that = this
175+
return (() => {
176+
that.listWrap = this.$refs.row.$el.offsetWidth;
177+
})()
178+
}
179+
},
180+
watch: {
181+
'listWrap': function(val){ //监听容器宽度变化
182+
this.pageSize = Math.floor(val / 252)
183+
this.initWorkspace();
184+
},
185+
},
168186
methods: {
169187
getWorkspaces() {
170188
// 获取工作空间数据

0 commit comments

Comments
 (0)