unlike composition api, refs are not reactive in options api
This commit is contained in:
parent
f6279c4478
commit
200d304190
3 changed files with 14 additions and 2 deletions
|
|
@ -153,6 +153,9 @@
|
|||
:focused="focused === element.id || focused === element.item.retweeted_status?.id"
|
||||
|
||||
:data-status-id="element.id"
|
||||
:data-vs-height="element.height"
|
||||
:data-vs-top="element.top"
|
||||
|
||||
@goto="setFocused"
|
||||
@toggle-expanded="toggleExpanded"
|
||||
@suspendable-state-change="changeSuspendStateLinearLocal"
|
||||
|
|
|
|||
|
|
@ -597,12 +597,17 @@ const Status = {
|
|||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.$refs.root) {
|
||||
this.resizeObserver.observe(this.$refs.root)
|
||||
}
|
||||
},
|
||||
unmounted() {
|
||||
this.resizeObserver.disconnect()
|
||||
},
|
||||
watch: {
|
||||
'$refs.root': function (element) {
|
||||
if (element) {
|
||||
hideStatus: function (element) {
|
||||
if (this.$refs.root) {
|
||||
this.resizeObserver.observe(this.$refs.root)
|
||||
} else {
|
||||
this.resizeObserver.disconnect()
|
||||
|
|
|
|||
|
|
@ -90,6 +90,10 @@
|
|||
v-if="element.type === 'item'"
|
||||
:status-id="element.item.id"
|
||||
role="listitem"
|
||||
|
||||
:data-vs-height="element.height"
|
||||
:data-vs-top="element.top"
|
||||
|
||||
@suspendable-state-change="changeSuspendState"
|
||||
@height-change="updateVirtualHeight"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue