- aggiornamento con proj RISO. postcss, pwa.
This commit is contained in:
0
src/components/CMyDialog/CMyDialog.scss
Executable file
0
src/components/CMyDialog/CMyDialog.scss
Executable file
59
src/components/CMyDialog/CMyDialog.ts
Executable file
59
src/components/CMyDialog/CMyDialog.ts
Executable file
@@ -0,0 +1,59 @@
|
||||
import { defineComponent, onMounted, ref, computed, watch } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyDialog',
|
||||
emits: ['update:modelValue'],
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const userStore = useUserStore()
|
||||
const { t } = useI18n();
|
||||
|
||||
const internalModel = ref(props.modelValue)
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
internalModel.value = newVal
|
||||
}
|
||||
)
|
||||
|
||||
watch(internalModel, (newVal) => {
|
||||
emit('update:modelValue', newVal)
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
userStore,
|
||||
costanti,
|
||||
tools,
|
||||
toolsext,
|
||||
shared_consts,
|
||||
t,
|
||||
internalModel,
|
||||
}
|
||||
}
|
||||
})
|
||||
26
src/components/CMyDialog/CMyDialog.vue
Executable file
26
src/components/CMyDialog/CMyDialog.vue
Executable file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<q-dialog v-model="internalModel" maximized
|
||||
transition-show="slide-up"
|
||||
transition-hide="slide-down"
|
||||
>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ title }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
|
||||
<q-card-section class="inset-shadow">
|
||||
<slot></slot>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyDialog.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyDialog';
|
||||
</style>
|
||||
1
src/components/CMyDialog/index.ts
Executable file
1
src/components/CMyDialog/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMyDialog} from './CMyDialog.vue'
|
||||
Reference in New Issue
Block a user