refactor(components): replace uni.$emit with event emitter
update Feedback and CreateServiceOrder components to use the imported @/utils/events emitter instead of global uni.$emit, reducing reliance on global properties for better maintainability and consistency
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, nextTick, defineProps, watch } from "vue";
|
||||
import { emitter } from '@/utils/events'
|
||||
import { SCROLL_TO_BOTTOM } from "@/constants/constant";
|
||||
import { createWorkOrder } from "@/api/workOrder";
|
||||
import { uploadFile } from "@/api/upload";
|
||||
@@ -220,7 +221,7 @@ const divWorkOrder = () => {
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
uni.$emit(SCROLL_TO_BOTTOM, true);
|
||||
emitter.emit(SCROLL_TO_BOTTOM, true);
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick, computed } from "vue";
|
||||
import { emitter } from '@/utils/events'
|
||||
import { SCROLL_TO_BOTTOM } from "@/constants/constant";
|
||||
import { getCurrentConfig } from "@/constants/base";
|
||||
import { submitFeedback } from "@/api/home";
|
||||
@@ -102,7 +103,7 @@ const sendFeedback = async () => {
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
uni.$emit(SCROLL_TO_BOTTOM, true);
|
||||
emitter.emit(SCROLL_TO_BOTTOM, true);
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user