made withLoadMore work... sorta

This commit is contained in:
Henry Jameson 2022-03-18 13:32:36 +02:00
parent 26bfbdc2ad
commit b3ed29ff02
5 changed files with 13 additions and 14 deletions

View file

@ -17,7 +17,9 @@ import FaviconService from '../services/favicon_service/favicon_service.js'
// disable compat for certain features // disable compat for certain features
configureCompat({ configureCompat({
COMPONENT_V_MODEL: false COMPONENT_V_MODEL: false,
INSTANCE_SET: false,
RENDER_FUNCTION: false
}) })
let staticInitialResults = null let staticInitialResults = null

View file

@ -69,7 +69,7 @@ export default (store) => {
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) }, { name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute }, { name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
{ name: 'about', path: '/about', component: About }, { name: 'about', path: '/about', component: About },
{ name: 'user-profile', path: '/(users/)?:name', component: UserProfile } { name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile }
] ]
if (store.state.instance.pleromaChatMessagesAvailable) { if (store.state.instance.pleromaChatMessagesAvailable) {

View file

@ -1,5 +1,5 @@
import Attachment from '../attachment/attachment.vue' import Attachment from '../attachment/attachment.vue'
import { sumBy } from 'lodash' import { sumBy, set } from 'lodash'
const Gallery = { const Gallery = {
props: [ props: [
@ -85,7 +85,7 @@ const Gallery = {
}, },
methods: { methods: {
onNaturalSizeLoad ({ id, width, height }) { onNaturalSizeLoad ({ id, width, height }) {
this.$set(this.sizes, id, { width, height }) set(this.sizes, id, { width, height })
}, },
rowStyle (row) { rowStyle (row) {
if (row.audio) { if (row.audio) {

View file

@ -43,14 +43,14 @@ export default {
}, },
data () { data () {
return { return {
active: findFirstUsable(this.$slots.default) active: findFirstUsable(this.$slots.default())
} }
}, },
computed: { computed: {
activeIndex () { activeIndex () {
// In case of controlled component // In case of controlled component
if (this.activeTab) { if (this.activeTab) {
return this.$slots.default.findIndex(slot => this.activeTab === slot.key) return this.$slots.default().findIndex(slot => this.activeTab === slot.key)
} else { } else {
return this.active return this.active
} }
@ -74,7 +74,7 @@ export default {
}, },
// DO NOT put it to computed, it doesn't work (caching?) // DO NOT put it to computed, it doesn't work (caching?)
slots () { slots () {
return this.$slots.default return this.$slots.default()
}, },
setTab (index) { setTab (index) {
if (typeof this.onSwitch === 'function') { if (typeof this.onSwitch === 'function') {

View file

@ -82,14 +82,11 @@ const withLoadMore = ({
}, },
render () { render () {
const props = { const props = {
props: {
...this.$props, ...this.$props,
[childPropName]: this.entries [childPropName]: this.entries
}, // on: this.$listeners // TODO fix listeners
on: this.$listeners,
scopedSlots: this.$scopedSlots
} }
const children = Object.entries(this.$slots).map(([key, value]) => h('template', { slot: key }, value)) const children = this.$slots
return ( return (
<div class="with-load-more"> <div class="with-load-more">
<WrappedComponent {...props}> <WrappedComponent {...props}>