Skip to content

Commit

Permalink
update lockscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
zhigang.li committed Dec 5, 2017
1 parent 8c0e89a commit 22382fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/views/main-components/lockscreen/lockscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<script>
import Cookies from 'js-cookie';
const setLockBackSize = () => {
let x = document.body.clientWidth;
let y = document.body.clientHeight;
let r = Math.sqrt(x * x + y * y);
return parseInt(r);
};
export default {
name: 'lockScreen',
props: {
Expand Down Expand Up @@ -42,21 +48,15 @@ export default {
document.body.appendChild(lockdiv);
lockScreenBack = document.getElementById('lock_screen_back');
window.addEventListener('resize', () => {
let x = document.body.clientWidth;
let y = document.body.clientHeight;
let r = Math.sqrt(x * x + y * y);
let size = parseInt(r);
let size = setLockBackSize();
this.lockScreenSize = size;
lockScreenBack.style.transition = 'all 0s';
lockScreenBack.style.width = lockScreenBack.style.height = size + 'px';
});
} else {
lockScreenBack = document.getElementById('lock_screen_back');
}
let x = document.body.clientWidth;
let y = document.body.clientHeight;
let r = Math.sqrt(x * x + y * y);
let size = parseInt(r);
let size = setLockBackSize();
this.lockScreenSize = size;
lockScreenBack.style.transition = 'all 3s';
lockScreenBack.style.width = lockScreenBack.style.height = size + 'px';
Expand Down
6 changes: 3 additions & 3 deletions src/views/tables/components/dragableTable.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<Table
:ref="refs"
ref="dragable"
:columns="columnsList"
:data="value"
highlight-row
Expand All @@ -16,7 +16,6 @@ import Sortable from 'sortablejs';
export default {
name: 'DragableTable',
props: {
refs: String,
columnsList: Array,
value: Array
},
Expand All @@ -39,7 +38,7 @@ export default {
}
},
mounted () {
var el = this.$refs[this.refs].$children[1].$el.children[1];
var el = this.$refs.dragable.$children[1].$el.children[1];
let vm = this;
Sortable.create(el, {
onStart: vm.startFunc,
Expand All @@ -49,3 +48,4 @@ export default {
}
};
</script>

7 changes: 6 additions & 1 deletion src/views/tables/dragable-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
<Row>
<Col span="16">
<Card>
<DragableTable refs="table1" v-model="tableData" :columnsList="columnsList" @on-start="handleOnstart1" @on-end="handleOnend1" ></DragableTable>
<DragableTable
v-model="tableData"
:columns-list="columnsList"
@on-start="handleOnstart1"
@on-end="handleOnend1"
></DragableTable>
</Card>
</Col>
<Col span="8" class="padding-left-10 height-100" >
Expand Down

0 comments on commit 22382fa

Please sign in to comment.