Skip to content

Commit

Permalink
🐛 fix(action): 处理移动端按钮遮挡问题,现在打开操作按钮全靠意念
Browse files Browse the repository at this point in the history
长按任意页面即可打开该页面操作按钮,隐藏同理
  • Loading branch information
Teeoo committed Dec 4, 2021
1 parent 4e6f306 commit ea8e138
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<q-layout view='lHh Lpr lFf' v-touch-hold.mouse='handleMiniShell'>
<q-header elevated class='bg-purple' v-touch-swipe.mouse.right='handleMiniShell'>
<q-layout view='lHh Lpr lFf'>
<q-header elevated class='bg-purple' v-touch-hold.mouse='handleMiniShell' v-touch-swipe.mouse.right='handleMiniShell'>
<q-toolbar>
<q-btn flat round dense icon='menu' @click='toggleLeftDrawer' class='q-mr-sm' />
<q-space></q-space>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/jsmanage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<q-page>
<q-page
v-touch-hold.mouse='()=>handleSwipe=!handleSwipe'>
<q-card flat>
<q-card-section>
<div class='row'>
Expand Down Expand Up @@ -136,7 +137,7 @@
</q-card-section>
</q-card>
</q-dialog>
<q-page-sticky position='bottom-right' :offset='[18, 18]'>
<q-page-sticky v-show='handleSwipe' position='bottom-right' :offset='[18, 18]'>
<q-fab
v-model='draggingFab'
color='purple'
Expand Down Expand Up @@ -192,7 +193,7 @@ export default defineComponent({
const isOpenLog = ref(false);
const downloadForm = ref(null);
const draggingFab = ref(false);

const handleSwipe=ref(false)

const message = ref<string[]>([]);
const ws = inject('ws') as WebSocket;
Expand Down Expand Up @@ -369,7 +370,8 @@ export default defineComponent({
isOpenLog,
message,
draggingFab,
validation
validation,
handleSwipe
};
}
});
Expand Down
8 changes: 5 additions & 3 deletions src/pages/mitm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<q-page>
<q-page v-touch-hold.mouse='()=>handleSwipe=!handleSwipe'>
<q-table
flat
separator='none'
Expand Down Expand Up @@ -27,7 +27,7 @@
</q-tr>
</template>
</q-table>
<q-page-sticky position='bottom-right' :offset='[18, 18]'>
<q-page-sticky v-show='handleSwipe' position='bottom-right' :offset='[18, 18]'>
<q-fab
v-model='draggingFab'
color='purple'
Expand Down Expand Up @@ -124,6 +124,7 @@ export default defineComponent({
const mitm = ref<Partial<Mitm>>({});
const draggingFab = ref(false);
const dialog = ref(false);
const handleSwipe = ref(false);
const commonName = ref('elecV2P');
const overwrite = ref(false);

Expand Down Expand Up @@ -264,7 +265,8 @@ export default defineComponent({
overwrite,
generate,
tempcaches,
clear
clear,
handleSwipe
};
}
});
Expand Down
12 changes: 8 additions & 4 deletions src/pages/rewrite.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<q-page>
<q-page
v-touch-hold.mouse='()=>handleSwipe=!handleSwipe'
>
<q-table
flat
separator='none'
Expand Down Expand Up @@ -145,7 +147,7 @@
</template>
</q-table>
</q-card-section>
<q-page-sticky position='bottom-right' :offset='[18, 18]'>
<q-page-sticky v-show='handleSwipe' position='bottom-right' :offset='[18, 18]'>
<q-fab
v-model='draggingFab'
color='purple'
Expand All @@ -159,7 +161,7 @@
</q-page-sticky>
</q-card>
</q-dialog>
<q-page-sticky position='bottom-right' :offset='[18, 18]'>
<q-page-sticky v-show='handleSwipe' position='bottom-right' :offset='[18, 18]'>
<q-fab
v-model='draggingFab'
color='purple'
Expand Down Expand Up @@ -245,6 +247,7 @@ export default defineComponent({
const maximizedToggle = ref(true);
const pagination = ref({ sortBy: 'desc', descending: false, page: 1, rowsPerPage: 5 });
const paginationSub = ref({ sortBy: 'desc', descending: false, page: 1, rowsPerPage: 5 });
const handleSwipe = ref(false);
onMounted(async () => {
try {
const data: RewriteLists = await api.get('data?type=rewritelists');
Expand Down Expand Up @@ -361,7 +364,8 @@ export default defineComponent({
dialog,
maximizedToggle,
delSubRes,
getContent
getContent,
handleSwipe
};
}
});
Expand Down
20 changes: 12 additions & 8 deletions src/pages/rules.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<q-page>
<q-page
v-touch-hold.mouse='()=>handleSwipe=!handleSwipe'
>
<q-table
flat
separator='none'
Expand All @@ -19,8 +21,8 @@
<q-td key='ctype' :props='props'>
<q-select color='pink' v-model='props.row.ctype' :options='ctype'
option-value="val"
option-label="label"
option-value='val'
option-label='label'
emit-value
map-options label='修改方式' />
</q-td>
Expand All @@ -31,8 +33,8 @@
<q-td key='stage' :props='props'>
<q-select color='pink' v-model='props.row.stage' :options='stage'
option-value="val"
option-label="label"
option-value='val'
option-label='label'
emit-value
map-options
label='修改时间' />
Expand All @@ -51,7 +53,7 @@
</q-tr>
</template>
</q-table>
<q-page-sticky position='bottom-right' :offset='[18, 18]'>
<q-page-sticky v-show='handleSwipe' position='bottom-right' :offset='[18, 18]'>
<q-fab
v-model='draggingFab'
color='purple'
Expand All @@ -66,6 +68,7 @@
</template>
<script lang='ts'>
import { defineComponent, onMounted, ref } from 'vue';
import { api } from 'boot/axios';
import { useQuasar } from 'quasar';
Expand All @@ -85,7 +88,7 @@ const ctype = [
{ label: '307 重定向', val: '307' },
{ label: '阻止', val: 'block' },
{ label: '$HOLD', val: 'hold' },
{ label: 'User-Agent', val: 'ua' },
{ label: 'User-Agent', val: 'ua' }
];
const stage = [{ label: '网络请求前', val: 'req' }, { label: '数据返回前', val: 'res' }];
Expand Down Expand Up @@ -132,6 +135,7 @@ export default defineComponent({
const rule = ref<Partial<Rules>>({});
const header = ref(columns);
const draggingFab = ref(false);
const handleSwipe = ref(false);
const pagination = ref({ sortBy: 'desc', descending: false, page: 1, rowsPerPage: 5 });
onMounted(async () => {
try {
Expand Down Expand Up @@ -186,7 +190,7 @@ export default defineComponent({
};
return {
rule, header, mtype, ctype, stage, del, save, draggingFab, insert, pagination
rule, header, mtype, ctype, stage, del, save, draggingFab, insert, pagination, handleSwipe
};
}
});
Expand Down
8 changes: 5 additions & 3 deletions src/pages/task.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<q-page>
<q-page v-touch-hold.mouse='()=>handleSwipe=!handleSwipe'>
<q-table
flat
row-key='name'
Expand Down Expand Up @@ -203,7 +203,7 @@
</q-card-section>
</q-card>
</q-dialog>
<q-page-sticky position='bottom-right' :offset='[18, 18]'>
<q-page-sticky v-show='handleSwipe' position='bottom-right' :offset='[18, 18]'>
<q-fab
v-model='draggingFab'
color='purple'
Expand Down Expand Up @@ -311,6 +311,7 @@ export default defineComponent({
const isOpenLog = ref(false);
const dialog = ref(false);
const maximizedToggle = ref(true);
const handleSwipe=ref(false)
const pagination = ref({
sortBy: 'desc',
descending: false,
Expand Down Expand Up @@ -614,7 +615,8 @@ export default defineComponent({
filterTask,
addTask,
taskSubList,
insert
insert,
handleSwipe
};
}
});
Expand Down

0 comments on commit ea8e138

Please sign in to comment.