3
in ur case, i will using ref to get lastChildElement div by using lastElementChild
First, to get the last child element
this.$refs.busstop.lastElementChild
and to style for this element
this.$refs.busstop.lastElementChild.style.fontSize = "30px";
like that
- [Vuejs]-Binding a string in App.vue,will not update after change
- [Vuejs]-Vuex-persistedstate: How can I use getters with vuex-persistedstate?
1
Alright, so if I understand properly, you want to:
- have a parent w/ a reference
- select the last element of this specific parent
- get it’s window’s position from the top ?
Here is a demo on how to do this in CSS + Vue.
https://codesandbox.io/s/jovial-fog-td190?file=/src/App.vue
Source:stackexchange.com