Skip to content

Commit

Permalink
fix: Make value/type computed
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurewarth0920 committed Jan 1, 2024
1 parent de4220d commit 07643e9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const props = withDefaults(defineProps<{
const state = useStateEditorContext()
const bridgeRpc = useDevToolsBridgeRpc()
const value = computed(() => formatInspectorStateValue(props.data.value))
const type = computed(() => getInspectorStateValueType(props.data.value))
const stateFormatClass = computed(() => {
if (type.value === 'custom')
Expand All @@ -28,7 +29,6 @@ const stateFormatClass = computed(() => {
const { isExpanded, toggleCollapse } = useCollapse('inspector-state', `${props.no}-${props.depth}-${props.data.key}`)
const normalizedValue = computed(() => {
const value = formatInspectorStateValue(props.data.value)
const stateTypeName = (props.data as InspectorCustomState)._custom?.stateTypeName || props.data?.stateTypeName
if (stateTypeName === 'Reactive') {
return stateTypeName
Expand All @@ -38,7 +38,7 @@ const normalizedValue = computed(() => {
return ''
}
else {
const result = `<span class="state-value-${type}">${value}</span>`
const result = `<span class="state-value-${type.value}">${value.value}</span>`
if (stateTypeName)
return `${result} <span class="text-gray-500">(${stateTypeName})</span>`
Expand Down

0 comments on commit 07643e9

Please sign in to comment.