Skip to content

Commit

Permalink
fix(applet): add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Sep 4, 2024
1 parent 7f7982d commit 0141d81
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<script setup lang="ts">
import { computed, inject } from 'vue'
import type { Ref } from 'vue'
import Settings from '~/components/settings/Settings.vue'
import { useCustomInspectorState } from '~/composables/custom-inspector-state'
import Navbar from '~/components/basic/Navbar.vue'
import DevToolsHeader from '~/components/basic/DevToolsHeader.vue'
const settings = inject('pluginSettings')
const settings = inject<Ref<{
options: Record<string, unknown>
values: Record<string, unknown>
}>>('pluginSettings')!
const customInspectState = useCustomInspectorState()
const options = computed(() => settings.value.options)
const values = computed(() => settings.value.values)
Expand Down
3 changes: 2 additions & 1 deletion packages/applet/src/modules/custom-inspector/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, onUnmounted, ref, watch } from 'vue'
import { computed, onUnmounted, provide, ref, watch } from 'vue'
import { onRpcConnected, rpc } from '@vue/devtools-core'
import About from './components/About.vue'
Expand Down Expand Up @@ -74,6 +74,7 @@ function getInspectorInfo() {
})
rpc.value.getPluginSettings(props.id).then((settings) => {
if (settings.options) {
// @ts-expect-error skip type check
pluginSettings.value = settings
}
else {
Expand Down
7 changes: 6 additions & 1 deletion packages/applet/src/modules/pinia/components/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<script setup lang="ts">
import type { Ref } from 'vue'
import { computed, inject } from 'vue'
import Settings from '~/components/settings/Settings.vue'
import Navbar from '~/components/basic/Navbar.vue'
import DevToolsHeader from '~/components/basic/DevToolsHeader.vue'
const settings = inject('pluginSettings')
const settings = inject<Ref<{
options: Record<string, unknown>
values: Record<string, unknown>
}>>('pluginSettings')!
const options = computed(() => settings.value.options)
const values = computed(() => settings.value.values)
const inspectorId = 'pinia'
Expand Down
4 changes: 3 additions & 1 deletion packages/applet/src/modules/pinia/index.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script setup lang="ts">
import { onRpcConnected, rpc } from '@vue/devtools-core'
import { computed, provide, ref } from 'vue'
import About from './components/About.vue'
import Store from './components/store/Index.vue'
import Timeline from './components/timeline/Index.vue'
import Settings from './components/Settings.vue'
import { registerVirtualRouter } from '~/composables/virtual-router'
import { VirtualRoute, registerVirtualRouter } from '~/composables/virtual-router'
const pluginSettings = ref(null)
provide('pluginSettings', pluginSettings)
Expand Down Expand Up @@ -45,6 +46,7 @@ const { VirtualRouterView, restoreRouter } = registerVirtualRouter(routes, {
onRpcConnected(() => {
rpc.value.getPluginSettings('pinia').then((settings) => {
if (settings.options) {
// @ts-expect-error skip type check
pluginSettings.value = settings
}
else {
Expand Down

0 comments on commit 0141d81

Please sign in to comment.