refactor(home-components): replace uni event bus & migrate tailwind styles
Replace all global `uni.$emit` invocations with the custom event emitter from @/utils/events. Migrate component styles from separate SCSS files to inline Tailwind utility classes, and remove all unused SCSS style files.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { emitter } from '@/utils/events'
|
||||
import { SEND_MESSAGE_CONTENT_TEXT, SEND_MESSAGE_COMMAND_TYPE, SWITCH_TO_COMPANION_TAB } from "@/constants/constant";
|
||||
// import { navigateTo } from "@/router";
|
||||
import { getAccessToken } from "@/constants/token";
|
||||
@@ -143,7 +144,7 @@ const handleClick = async (item) => {
|
||||
}
|
||||
/// 提示词
|
||||
else if (item.jumpType === JumpType.prompt) {
|
||||
uni.$emit(SEND_MESSAGE_CONTENT_TEXT, item.jumpContent);
|
||||
emitter.emit(SEND_MESSAGE_CONTENT_TEXT, item.jumpContent);
|
||||
}
|
||||
/// 链接
|
||||
else if (item.jumpType === JumpType.link) {
|
||||
@@ -154,7 +155,7 @@ const handleClick = async (item) => {
|
||||
}
|
||||
/// 组件指令
|
||||
else if (item.jumpType === JumpType.command) {
|
||||
uni.$emit(SEND_MESSAGE_COMMAND_TYPE, { type: item.jumpContent, title: item.jumpDesc });
|
||||
emitter.emit(SEND_MESSAGE_COMMAND_TYPE, { type: item.jumpContent, title: item.jumpDesc });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user