Skip to content

Commit

Permalink
Update VueResultTopic to use vue3 h()
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Dec 9, 2024
1 parent 20a9b02 commit fd8c287
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions resources/js/pages/search.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import {VNode} from "vue";
import {h, VNode} from "vue";

import VueDropdownMenu from '../components/dropdown-menu.vue';
import VueAutocomplete from '../components/forms/autocomplete.vue';
Expand Down Expand Up @@ -91,9 +91,10 @@ const VueResultTopic = {
hits: {type: Array},
},
components: {'vue-topic': VueTopic},
render(createElement) {
render() {
const createElement = h;
let items: VNode[] = [];
this.hits.forEach(hit => items.push(createElement('vue-topic', {props: {topic: hit, postsPerPage: window.postsPerPage, showCategoryName: true}})));
this.hits.forEach(hit => items.push(createElement(VueTopic, {topic: hit, postsPerPage: window.postsPerPage, showCategoryName: true})));
return createElement('div', {class: 'card card-default card-topics'}, items);
},
};
Expand Down Expand Up @@ -212,7 +213,7 @@ createVueApp('Search', '#js-search', {
},

pushState() {
history.pushState({params: this.requestParams, hits: this.hits}, '', this.getUrl(this.requestParams));
// history.pushState({params: this.requestParams, hits: this.hits}, '', this.getUrl(this.requestParams));
},

popState(event) {
Expand Down

0 comments on commit fd8c287

Please sign in to comment.