Commit a2565a78 authored by Yuan Zhixiang's avatar Yuan Zhixiang
Browse files

自动移动到变化/新增的变量

parent 48faa92b
<script setup> <script setup>
import { computed, inject, ref, watch } from 'vue'; import { computed, inject, ref, watch, getCurrentInstance, nextTick } from 'vue';
const { current_step } = inject('app') const { current_step } = inject('app')
const { check_changed, highlight_addresses,current_var_map } = inject('stack_view') const { check_changed, highlight_addresses,current_var_map } = inject('stack_view')
...@@ -193,6 +193,20 @@ watch(current_step, () => { ...@@ -193,6 +193,20 @@ watch(current_step, () => {
pointer_color.value = -1 pointer_color.value = -1
}) })
watch(changed,(new_value)=>{
if(new_value == 'changed' || new_value == 'new'){
console.log('1')
nextTick(()=>{
current_instance.proxy.$el.nextElementSibling.scrollIntoView({
behavior: 'smooth',
block: 'center'
});
})
}
})
const current_instance = getCurrentInstance()
</script> </script>
<template> <template>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment