enrecipes/app/components/modal/ActionDialog.vue

51 lines
1.2 KiB
Vue
Raw Normal View History

2020-10-21 17:54:45 +00:00
<template>
<Page>
<StackLayout class="dialogContainer" :class="isLightMode">
2020-10-21 17:54:45 +00:00
<Label class="dialogTitle orkm" :text="title" />
2020-10-22 18:36:50 +00:00
<ListView
width="100%"
:height="height"
for="item in list"
@itemTap="tapAction"
separatorColor="transparent"
>
<v-template>
2020-11-02 11:36:53 +00:00
<Label class="actionItem" :text="item" />
2020-10-22 18:36:50 +00:00
</v-template>
</ListView>
2020-11-02 11:36:53 +00:00
<GridLayout rows="auto" columns="auto, *, auto" class="actionsContainer">
2020-10-21 17:54:45 +00:00
<Label
v-if="action"
col="0"
2020-11-02 11:36:53 +00:00
class="action orkm pull-left"
2020-10-21 17:54:45 +00:00
:text="action"
@tap="$modal.close(action)"
/>
<Label
col="2"
2020-11-02 11:36:53 +00:00
class="action orkm pull-right"
2020-10-21 17:54:45 +00:00
text="CANCEL"
@tap="$modal.close(false)"
/>
</GridLayout>
</StackLayout>
</Page>
</template>
<script>
import { Application } from "@nativescript/core"
2020-10-21 17:54:45 +00:00
export default {
props: ["title", "list", "height", "action"],
computed: {
isLightMode() {
return Application.systemAppearance()
},
2020-10-22 18:36:50 +00:00
},
2020-10-21 17:54:45 +00:00
methods: {
tapAction({ item }) {
this.$modal.close(item)
},
},
}
</script>