@7365admin1/layer-common 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.editorconfig +12 -0
- package/.github/workflows/main.yml +17 -0
- package/.github/workflows/publish.yml +39 -0
- package/.nuxtrc +1 -0
- package/.playground/app.vue +41 -0
- package/.playground/eslint.config.mjs +6 -0
- package/.playground/nuxt.config.ts +22 -0
- package/.playground/pages/feedback.vue +30 -0
- package/CHANGELOG.md +263 -0
- package/README.md +73 -0
- package/app.vue +3 -0
- package/components/AccessCardAddForm.vue +363 -0
- package/components/AccessManagement.vue +420 -0
- package/components/Avatar/Main.vue +68 -0
- package/components/BillingMain.vue +66 -0
- package/components/BtnUploadFile.vue +139 -0
- package/components/BuildingForm.vue +303 -0
- package/components/BuildingManagement/buildings.vue +335 -0
- package/components/BuildingManagement/units.vue +350 -0
- package/components/BuildingUnitFormAdd.vue +441 -0
- package/components/BuildingUnitFormEdit.vue +429 -0
- package/components/CameraForm.vue +264 -0
- package/components/CameraMain.vue +352 -0
- package/components/Card/DeleteConfirmation.vue +51 -0
- package/components/Card/MemberInfoSummary.vue +44 -0
- package/components/Card/Toggle.vue +25 -0
- package/components/Chat/Bubbles.vue +53 -0
- package/components/Chat/Information.vue +416 -0
- package/components/Chat/ListCard.vue +62 -0
- package/components/Chat/Message.vue +158 -0
- package/components/Chat/Navigation.vue +150 -0
- package/components/ConfirmDialog.vue +66 -0
- package/components/Container/Standard.vue +33 -0
- package/components/DashboardPlaceholder.vue +1524 -0
- package/components/Dialog/DeleteConfirmation.vue +51 -0
- package/components/Dialog/ReplaceAutofillPrompt.vue +49 -0
- package/components/Dialog/UpdateMoreAction.vue +103 -0
- package/components/DocumentForm.vue +187 -0
- package/components/DocumentManagement.vue +376 -0
- package/components/Editor.vue +95 -0
- package/components/EntryPassMain.vue +518 -0
- package/components/Feedback/Form.vue +173 -0
- package/components/FeedbackDetail.vue +599 -0
- package/components/FeedbackMain.vue +588 -0
- package/components/FormDialog.vue +65 -0
- package/components/ImageCarousel.vue +138 -0
- package/components/Input/Date.vue +177 -0
- package/components/Input/DateTimePicker.vue +131 -0
- package/components/Input/File.vue +236 -0
- package/components/Input/FileV2.vue +234 -0
- package/components/Input/InputPhoneNumberV2.vue +164 -0
- package/components/Input/ListGroupSelection.vue +96 -0
- package/components/Input/NRICNumber.vue +53 -0
- package/components/Input/NewDate.vue +123 -0
- package/components/Input/Number.vue +124 -0
- package/components/Input/Password.vue +22 -0
- package/components/Input/PhoneNumber.vue +188 -0
- package/components/Input/VehicleNumber.vue +49 -0
- package/components/InputLabel.vue +22 -0
- package/components/InvitationForm.vue +359 -0
- package/components/InvitationMain.vue +310 -0
- package/components/Layout/Header.vue +129 -0
- package/components/Layout/NavigationDrawer.vue +44 -0
- package/components/ListItem.vue +35 -0
- package/components/ListView.vue +87 -0
- package/components/LocalPagination.vue +31 -0
- package/components/MemberMain.vue +459 -0
- package/components/NFC/NFCPatrolReportMain.vue +591 -0
- package/components/NFC/NFCPatrolRouteForm.vue +596 -0
- package/components/NFC/NFCPatrolRouteMain.vue +539 -0
- package/components/NFC/NFCTagForm.vue +236 -0
- package/components/NFC/NFCTagMain.vue +337 -0
- package/components/NFC/PatrolSettings.vue +130 -0
- package/components/NavigationItem.vue +83 -0
- package/components/NumberSettingField.vue +107 -0
- package/components/OnlineFormConfigurationForm.vue +290 -0
- package/components/OnlineFormsConfiguration.vue +429 -0
- package/components/PeopleForm.vue +452 -0
- package/components/PlaceholderComponent.vue +34 -0
- package/components/RolePermissionFormCreate.vue +161 -0
- package/components/RolePermissionFormPreviewUpdate.vue +183 -0
- package/components/RolePermissionMain.vue +361 -0
- package/components/SearchVehicleNumberUser.vue +91 -0
- package/components/ServiceProviderFormCreate.vue +154 -0
- package/components/ServiceProviderMain.vue +547 -0
- package/components/SignaturePad.vue +73 -0
- package/components/Snackbar.vue +23 -0
- package/components/SpecificAttr.vue +53 -0
- package/components/SupplyManagement.vue +292 -0
- package/components/SwitchContext.vue +108 -0
- package/components/TableList.vue +150 -0
- package/components/TableListSecondary.vue +164 -0
- package/components/TableMain.vue +142 -0
- package/components/TableWithButton.vue +94 -0
- package/components/VehicleUpdateMoreAction.vue +84 -0
- package/components/VideoPlayer.vue +125 -0
- package/components/VisitorForm.vue +659 -0
- package/components/VisitorFormSelection.vue +53 -0
- package/components/VisitorManagement.vue +490 -0
- package/components/WorkOrder/Create.vue +284 -0
- package/components/WorkOrder/Detail.vue +71 -0
- package/components/WorkOrder/ListView.vue +96 -0
- package/components/WorkOrder/Main.vue +489 -0
- package/components/Workorder.vue +1 -0
- package/composables/useAddress.ts +107 -0
- package/composables/useBuilding.ts +250 -0
- package/composables/useBuildingUnit.ts +116 -0
- package/composables/useCard.ts +46 -0
- package/composables/useCommonPermission.ts +207 -0
- package/composables/useCustomer.ts +113 -0
- package/composables/useCustomerSite.ts +56 -0
- package/composables/useDashboard.ts +31 -0
- package/composables/useDashboardData.ts +425 -0
- package/composables/useDocument.ts +57 -0
- package/composables/useFacility.ts +246 -0
- package/composables/useFeedback.ts +119 -0
- package/composables/useFile.ts +55 -0
- package/composables/useInvoice.ts +18 -0
- package/composables/useLocal.ts +131 -0
- package/composables/useLocalAuth.ts +137 -0
- package/composables/useLocalSetup.ts +13 -0
- package/composables/useMember.ts +111 -0
- package/composables/useNFCPatrolRoute.ts +77 -0
- package/composables/useNFCPatrolSettings.ts +19 -0
- package/composables/useNFCPatrolTag.ts +53 -0
- package/composables/useOnlineForm.ts +67 -0
- package/composables/useOrg.ts +129 -0
- package/composables/usePDFDownload.ts +25 -0
- package/composables/usePaymentMethod.ts +101 -0
- package/composables/usePeople.ts +81 -0
- package/composables/usePermission.ts +54 -0
- package/composables/usePhoneCountries.ts +561 -0
- package/composables/usePrice.ts +15 -0
- package/composables/usePromoCode.ts +36 -0
- package/composables/useRecapPermission.ts +26 -0
- package/composables/useRole.ts +104 -0
- package/composables/useSecurityUtils.ts +18 -0
- package/composables/useServiceProvider.ts +224 -0
- package/composables/useSite.ts +109 -0
- package/composables/useSiteEntryPassSettings.ts +46 -0
- package/composables/useSiteSettings.ts +123 -0
- package/composables/useSubscription.ts +150 -0
- package/composables/useUser.ts +132 -0
- package/composables/useUtils.ts +445 -0
- package/composables/useVerification.ts +34 -0
- package/composables/useVisitor.ts +120 -0
- package/composables/useWorkOrder.ts +85 -0
- package/error.vue +41 -0
- package/layouts/plain.vue +7 -0
- package/middleware/01.auth.ts +20 -0
- package/middleware/02.org.ts +21 -0
- package/middleware/03.customer.ts +13 -0
- package/middleware/member.ts +4 -0
- package/nuxt.config.ts +54 -0
- package/package.json +39 -0
- package/pages/index.vue +3 -0
- package/pages/payment-method-linked.vue +31 -0
- package/pages/require-customer.vue +56 -0
- package/pages/require-organization-membership.vue +47 -0
- package/pages/unauthorized.vue +29 -0
- package/plugins/API.ts +21 -0
- package/plugins/iconify.client.ts +5 -0
- package/plugins/secure-member.client.ts +86 -0
- package/plugins/vuetify.ts +62 -0
- package/public/bg-camera.jpg +0 -0
- package/public/bg-city.jpg +0 -0
- package/public/bg-condo.jpg +0 -0
- package/public/images/icons/delete-icon.png +0 -0
- package/public/sprite.svg +1 -0
- package/tsconfig.json +3 -0
- package/types/address.d.ts +13 -0
- package/types/building.d.ts +27 -0
- package/types/camera.d.ts +31 -0
- package/types/card.d.ts +22 -0
- package/types/customer.d.ts +27 -0
- package/types/document.d.ts +6 -0
- package/types/feedback.d.ts +68 -0
- package/types/local.d.ts +74 -0
- package/types/member.d.ts +21 -0
- package/types/online-form.d.ts +15 -0
- package/types/org.d.ts +13 -0
- package/types/people.d.ts +24 -0
- package/types/permission.d.ts +25 -0
- package/types/phone-number.d.ts +10 -0
- package/types/price.d.ts +17 -0
- package/types/promo-code.d.ts +19 -0
- package/types/role.d.ts +11 -0
- package/types/select.d.ts +4 -0
- package/types/service-provider.d.ts +15 -0
- package/types/site.d.ts +20 -0
- package/types/subscription.d.ts +23 -0
- package/types/user.d.ts +19 -0
- package/types/verification.d.ts +20 -0
- package/types/visitor.d.ts +42 -0
- package/types/work-order.d.ts +42 -0
- package/utils/phoneMasks.ts +1703 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-app-bar scroll-behavior="elevate" scroll-threshold="200">
|
|
3
|
+
<v-app-bar-nav-icon v-if="!props.hideNavIcon" @click="drawer = !drawer"></v-app-bar-nav-icon>
|
|
4
|
+
|
|
5
|
+
<template #append>
|
|
6
|
+
<v-btn icon="mdi-theme-light-dark" variant="text" class="mx-2" @click="toggleTheme" />
|
|
7
|
+
|
|
8
|
+
<v-menu offset="10px" :close-on-content-click="false">
|
|
9
|
+
<template #activator="{ props }">
|
|
10
|
+
<v-btn fab variant="text" icon v-bind="props" class="mx-2">
|
|
11
|
+
<AvatarMain :image-src="currentUser?.profile" :name="name" />
|
|
12
|
+
</v-btn>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<v-card width="350" max-height="600px" elevation="2" rounded="xl" class="pa-4">
|
|
16
|
+
<v-row no-gutters>
|
|
17
|
+
<v-col cols="12">
|
|
18
|
+
<v-row no-gutters justify="center">
|
|
19
|
+
<AvatarMain :image-src="currentUser?.profile" :name="name" />
|
|
20
|
+
</v-row>
|
|
21
|
+
</v-col>
|
|
22
|
+
|
|
23
|
+
<v-col cols="12" class="text-center mt-2 mb-4">
|
|
24
|
+
{{ name }}
|
|
25
|
+
</v-col>
|
|
26
|
+
|
|
27
|
+
<v-col cols="12" class="mb-3">
|
|
28
|
+
<v-btn v-if="APP_NAME.toLowerCase() !== 'account'" block rounded="xl" variant="tonal" size="x-large"
|
|
29
|
+
class="text-none text-subtitle-1 font-weight-regular" @click="redirect(APP_ACCOUNT, 'home')">
|
|
30
|
+
Manage Account
|
|
31
|
+
</v-btn>
|
|
32
|
+
</v-col>
|
|
33
|
+
|
|
34
|
+
<v-col cols="12">
|
|
35
|
+
<v-btn block rounded="xl" variant="tonal" size="x-large"
|
|
36
|
+
class="text-none text-subtitle-1 font-weight-regular" @click="logout()">
|
|
37
|
+
Logout
|
|
38
|
+
</v-btn>
|
|
39
|
+
</v-col>
|
|
40
|
+
</v-row>
|
|
41
|
+
</v-card>
|
|
42
|
+
</v-menu>
|
|
43
|
+
</template>
|
|
44
|
+
</v-app-bar>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { useTheme } from "vuetify";
|
|
49
|
+
|
|
50
|
+
const props = defineProps({
|
|
51
|
+
hideNavIcon: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const menu = defineModel("menu", { type: Boolean });
|
|
58
|
+
|
|
59
|
+
const search = defineModel("search", { type: String });
|
|
60
|
+
|
|
61
|
+
const { drawer } = useLocal();
|
|
62
|
+
|
|
63
|
+
const { redirect } = useUtils();
|
|
64
|
+
|
|
65
|
+
const { APP_ACCOUNT, APP_MAIN, APP_NAME } = useRuntimeConfig().public;
|
|
66
|
+
|
|
67
|
+
const theme = useTheme();
|
|
68
|
+
|
|
69
|
+
function toggleTheme() {
|
|
70
|
+
theme.global.name.value = theme.global.current.value.dark ? "light" : "dark";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const { currentUser } = useLocalAuth();
|
|
74
|
+
|
|
75
|
+
const profile = computed(() => {
|
|
76
|
+
return `/api/public/${currentUser.value?.profile}`;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
function logout() {
|
|
80
|
+
if (APP_NAME.toLowerCase() !== "main") {
|
|
81
|
+
redirect(APP_MAIN, "logout");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
useRouter().push({ name: "logout" });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const name = computed(() => {
|
|
89
|
+
const user = currentUser.value;
|
|
90
|
+
if(!user) return "";
|
|
91
|
+
|
|
92
|
+
const first = user?.firstName?.trim() || ""
|
|
93
|
+
const last = user?.lastName?.trim() || ""
|
|
94
|
+
const full = [first, last].filter(Boolean).join(" ")
|
|
95
|
+
|
|
96
|
+
if(full) return full;
|
|
97
|
+
|
|
98
|
+
const alternative = user?.name?.trim();
|
|
99
|
+
return alternative || ""
|
|
100
|
+
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
const { getNameInitials } = useUtils();
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style scoped>
|
|
108
|
+
.APP_NAME {
|
|
109
|
+
display: inline-block;
|
|
110
|
+
word-wrap: break-word;
|
|
111
|
+
white-space: normal;
|
|
112
|
+
text-align: center;
|
|
113
|
+
color: unset !important;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.open-list {
|
|
117
|
+
transition: transform 0.2s ease-in-out;
|
|
118
|
+
transform: rotate(180deg);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.close-list {
|
|
122
|
+
transition: transform 0.3s ease-in-out;
|
|
123
|
+
transform: rotate(0deg);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.v-list-group__items .v-list-item {
|
|
127
|
+
padding-inline-start: 32px !important;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-navigation-drawer v-model="drawer" permanent floating class="bg-primary">
|
|
3
|
+
<v-list>
|
|
4
|
+
<v-list-item>
|
|
5
|
+
<v-list-item-title class="text-h6 text-white">
|
|
6
|
+
{{ APP_NAME }}
|
|
7
|
+
</v-list-item-title>
|
|
8
|
+
</v-list-item>
|
|
9
|
+
<slot name="action" />
|
|
10
|
+
<template
|
|
11
|
+
v-for="(navigationItem, navigationIndex) in props.navigationItems"
|
|
12
|
+
:key="`${navigationItem.title}-${navigationIndex}`"
|
|
13
|
+
>
|
|
14
|
+
<NavigationItem
|
|
15
|
+
v-if="navigationItem.children?.length"
|
|
16
|
+
:title="navigationItem.title"
|
|
17
|
+
:icon="navigationItem.icon"
|
|
18
|
+
:route="navigationItem.route"
|
|
19
|
+
:children="navigationItem.children"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<NavigationItem
|
|
23
|
+
v-else-if="navigationItem.route"
|
|
24
|
+
:title="navigationItem.title"
|
|
25
|
+
:icon="navigationItem.icon"
|
|
26
|
+
:link="navigationItem.link"
|
|
27
|
+
:route="navigationItem.route"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<slot name="services"> </slot>
|
|
32
|
+
</v-list>
|
|
33
|
+
</v-navigation-drawer>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
navigationItems: { type: Array<TNavigationItem>, required: true },
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const { drawer } = useLocal();
|
|
42
|
+
|
|
43
|
+
const { APP_NAME } = useRuntimeConfig().public;
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-list-item :class="props.divider ? border : defaultBorder">
|
|
3
|
+
<v-row>
|
|
4
|
+
<v-col cols="4" class="text-subtitle-2">
|
|
5
|
+
<slot name="title"> List Title </slot>
|
|
6
|
+
</v-col>
|
|
7
|
+
|
|
8
|
+
<v-col cols="8" class="text-subtitle-2">
|
|
9
|
+
<slot name="value"> value </slot>
|
|
10
|
+
</v-col>
|
|
11
|
+
</v-row>
|
|
12
|
+
|
|
13
|
+
<template #append>
|
|
14
|
+
<slot name="append">
|
|
15
|
+
<v-icon size="30">{{ props.icon }}</v-icon>
|
|
16
|
+
</slot>
|
|
17
|
+
</template>
|
|
18
|
+
</v-list-item>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
divider: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true,
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "mdi-chevron-right",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const defaultBorder = "pa-0 pl-8 pr-6 py-4";
|
|
34
|
+
const border = "border-b-sm" + " " + defaultBorder;
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TableListSecondary
|
|
3
|
+
:headers="headers"
|
|
4
|
+
:items="items"
|
|
5
|
+
:pages="pages"
|
|
6
|
+
:page-range="pageRange"
|
|
7
|
+
:loading="loading"
|
|
8
|
+
:height="height"
|
|
9
|
+
:page="page"
|
|
10
|
+
v-model="selected"
|
|
11
|
+
@update:pagination="_getItems"
|
|
12
|
+
@click:row="onRowClick"
|
|
13
|
+
:length="pages"
|
|
14
|
+
:clickable-rows="clickableRows"
|
|
15
|
+
@update:page="onPageChange"
|
|
16
|
+
>
|
|
17
|
+
<template #title>
|
|
18
|
+
<slot name="title" />
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<template #action-button>
|
|
22
|
+
<slot name="action-button" />
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<template
|
|
26
|
+
v-for="header in headers"
|
|
27
|
+
:key="header.value"
|
|
28
|
+
#[header.value]="slotProps"
|
|
29
|
+
>
|
|
30
|
+
<slot :name="header.value" v-bind="slotProps" />
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<template #action-table="{ item }">
|
|
34
|
+
<slot name="action-table" :item="item" />
|
|
35
|
+
</template>
|
|
36
|
+
</TableListSecondary>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script lang="ts" setup>
|
|
40
|
+
import { getCurrentInstance } from "vue";
|
|
41
|
+
import { useRoute, useRouter } from "vue-router";
|
|
42
|
+
|
|
43
|
+
const emit = defineEmits(["click:create", "update:pagination", "row-click"]);
|
|
44
|
+
const page = defineModel("page", { type: Number, default: 1 });
|
|
45
|
+
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
headers: Array as PropType<any[]>,
|
|
48
|
+
items: Array as PropType<any[]>,
|
|
49
|
+
pages: Number,
|
|
50
|
+
pageRange: String,
|
|
51
|
+
page: Number,
|
|
52
|
+
loading: Boolean,
|
|
53
|
+
height: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "calc(100vh - 175px)",
|
|
56
|
+
},
|
|
57
|
+
viewPage: Object as PropType<{ name: string }>,
|
|
58
|
+
org: String,
|
|
59
|
+
site: String,
|
|
60
|
+
id: String,
|
|
61
|
+
getItems: Function as PropType<() => Promise<void>>,
|
|
62
|
+
deleteItem: Function as PropType<(id: string) => Promise<void>>,
|
|
63
|
+
clickableRows: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const selected = ref<string[]>([]);
|
|
70
|
+
|
|
71
|
+
async function _getItems() {
|
|
72
|
+
if (props.getItems) {
|
|
73
|
+
await props.getItems();
|
|
74
|
+
emit("update:pagination");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function onPageChange(newPage: number) {
|
|
79
|
+
page.value = newPage;
|
|
80
|
+
_getItems();
|
|
81
|
+
emit("update:pagination", newPage);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function onRowClick(item: any) {
|
|
85
|
+
emit("row-click", item);
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="arrow-navigation">
|
|
3
|
+
<v-btn icon="mdi-chevron-left" variant="text" density="comfortable" :disabled="page <= 1" @click="decrement" />
|
|
4
|
+
<v-btn
|
|
5
|
+
icon="mdi-chevron-right" variant="text" density="comfortable" :disabled="page >= props.length"
|
|
6
|
+
@click="increment" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const page = defineModel({ type: Number, default: 0 });
|
|
12
|
+
function increment() {
|
|
13
|
+
page.value++;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function decrement() {
|
|
17
|
+
page.value--;
|
|
18
|
+
}
|
|
19
|
+
const emit = defineEmits(['update:value']);
|
|
20
|
+
watch(page, () => {
|
|
21
|
+
emit('update:value', page.value);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
length: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: true,
|
|
28
|
+
default: 0
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
</script>
|