-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- show bottom prompt for deciding if you want to navigate to the form or to the filtered transactions list
- Loading branch information
1 parent
a42598a
commit 20e3136
Showing
6 changed files
with
135 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<van-action-sheet v-model:show="show" :actions="actions" :close-on-click-overlay="true" :close-on-click-action="true" title="Select an option"> | ||
<!-- <template #description>--> | ||
<!-- <!– TODO: Find solution. Sadly using this component with h() render function doesnt work for app-icon because of dynamic component usage.... –>--> | ||
<!-- <app-icon :icon="TablerIconConstants.account" :size="20" />--> | ||
<!-- Debug--> | ||
<!-- </template>--> | ||
<template #action="{ action, index }"> | ||
<div class="flex-center"> | ||
<div>{{ action.name }}</div> | ||
</div> | ||
</template> | ||
</van-action-sheet> | ||
</template> | ||
|
||
<script setup> | ||
import TablerIconConstants from '~/constants/TablerIconConstants.js' | ||
import AppIcon from '~/components/ui-kit/app-icon.vue' | ||
const show = defineModel('show') | ||
const props = defineProps({ | ||
actions: {}, | ||
}) | ||
</script> | ||
|
||
<style></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { ref, h, render } from 'vue' | ||
// import { ActionSheet } from 'vant' | ||
import AppActionSheet from '~/components/ui-kit/app-action-sheet.vue' | ||
import 'vant/lib/action-sheet/index.css' | ||
|
||
export function useActionSheet() { | ||
const isVisible = ref(false) | ||
const actions = ref([]) | ||
let container = null | ||
let actionSheet = null | ||
|
||
const show = (newActions) => { | ||
actions.value = newActions | ||
|
||
if (!actionSheet) { | ||
initContainer() | ||
renderActionSheet() | ||
} | ||
|
||
isVisible.value = true | ||
} | ||
|
||
const initContainer = () => { | ||
container = document.createElement('div') | ||
document.body.appendChild(container) | ||
} | ||
|
||
const renderActionSheet = () => { | ||
actionSheet = h(AppActionSheet, { | ||
show: isVisible.value, | ||
'onUpdate:show': (newValue) => { | ||
isVisible.value = newValue | ||
}, | ||
cancelText: 'Cancel', | ||
actions: actions.value, | ||
}, { | ||
action: ({ action, index }) => h('div', `${action.name}`) | ||
}) | ||
|
||
render(actionSheet, container) | ||
} | ||
|
||
watch(isVisible, (newValue) => { | ||
renderActionSheet() | ||
}) | ||
|
||
return { | ||
show, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters