Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yuan Zhixiang
c-render-vue
Commits
a2565a78
Commit
a2565a78
authored
May 14, 2024
by
Yuan Zhixiang
Browse files
自动移动到变化/新增的变量
parent
48faa92b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/components/VarUnit.vue
View file @
a2565a78
<
script
setup
>
import
{
computed
,
inject
,
ref
,
watch
}
from
'
vue
'
;
import
{
computed
,
inject
,
ref
,
watch
,
getCurrentInstance
,
nextTick
}
from
'
vue
'
;
const
{
current_step
}
=
inject
(
'
app
'
)
const
{
check_changed
,
highlight_addresses
,
current_var_map
}
=
inject
(
'
stack_view
'
)
...
...
@@ -193,6 +193,20 @@ watch(current_step, () => {
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
>
<
template
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment