mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-15 17:57:21 +00:00
scroll works on other pages
This commit is contained in:
parent
6b1b71d3cc
commit
98a7a7999c
@ -31,7 +31,7 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ref, watch, reactive, defineComponent } from "vue";
|
import { ref, watch, onMounted, defineComponent } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
@ -50,7 +50,7 @@ export default defineComponent({
|
|||||||
components: { ...Configuration, ...controls },
|
components: { ...Configuration, ...controls },
|
||||||
setup() {
|
setup() {
|
||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const tobewatched = reactive(dashboardStore);
|
// const tobewatched = reactive(dashboardStore);
|
||||||
// const appStore = useAppStoreWithOut();
|
// const appStore = useAppStoreWithOut();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const p = useRoute().params;
|
const p = useRoute().params;
|
||||||
@ -58,14 +58,16 @@ export default defineComponent({
|
|||||||
// setTemplate();
|
// setTemplate();
|
||||||
const currentItem = ref("");
|
const currentItem = ref("");
|
||||||
watch(
|
watch(
|
||||||
() => tobewatched.layout,
|
() => dashboardStore.layout,
|
||||||
() => {
|
() => {
|
||||||
|
// console.log('Watching:',currentItem.value)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
observeItems();
|
observeItems();
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
function scrollToGraph(e: any) {
|
function scrollToGraph(e: any) {
|
||||||
|
console.log(currentItem.value)
|
||||||
document?.getElementById(`item${e}`)?.scrollIntoView();
|
document?.getElementById(`item${e}`)?.scrollIntoView();
|
||||||
}
|
}
|
||||||
function observeItems() {
|
function observeItems() {
|
||||||
@ -80,6 +82,9 @@ export default defineComponent({
|
|||||||
observer.observe(element);
|
observer.observe(element);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
onMounted(()=>{
|
||||||
|
observeItems()
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
t,
|
t,
|
||||||
dashboardStore,
|
dashboardStore,
|
||||||
|
@ -248,7 +248,7 @@ export default defineComponent({
|
|||||||
() => {
|
() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
observeItems();
|
observeItems();
|
||||||
console.log("Last Value:", lastItem.value);
|
// console.log("Last Value:", lastItem.value);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user