mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
migrate switch to mobile dialog to composition API and typescript
This commit is contained in:
@@ -28,34 +28,31 @@
|
|||||||
</v-dialog>
|
</v-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { getMobileUrlQrCodePath } from '@/lib/qrcode.ts';
|
import { getMobileUrlQrCodePath } from '@/lib/qrcode.ts';
|
||||||
import { getMobileVersionPath } from '@/lib/version.ts';
|
import { getMobileVersionPath } from '@/lib/version.ts';
|
||||||
|
|
||||||
export default {
|
const props = defineProps<{
|
||||||
props: [
|
show: boolean;
|
||||||
'show'
|
}>();
|
||||||
],
|
|
||||||
emits: [
|
const emit = defineEmits<{
|
||||||
'update:show'
|
(e: 'update:show', value: boolean): void
|
||||||
],
|
}>();
|
||||||
data() {
|
|
||||||
return {
|
const mobileUrlQrCodePath = getMobileUrlQrCodePath();
|
||||||
mobileUrlQrCodePath: getMobileUrlQrCodePath(),
|
const mobileVersionPath = getMobileVersionPath();
|
||||||
mobileVersionPath: getMobileVersionPath(),
|
|
||||||
}
|
const showState = computed<boolean>({
|
||||||
|
get: () => {
|
||||||
|
return props.show;
|
||||||
},
|
},
|
||||||
computed: {
|
set: value => {
|
||||||
showState: {
|
emit('update:show', value);
|
||||||
get: function () {
|
|
||||||
return this.show;
|
|
||||||
},
|
|
||||||
set: function (value) {
|
|
||||||
this.$emit('update:show', value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user