Courses

Vue.js 3 + Laravel 9 SPA: CRUD with Auth

Extra Table Filters: Column and Global Filters

Previous: Delete Post with Confirmation Modal
avatar

Pagination links have gone...

👀 1
avatar

Index.vue, line 121:

<Pagination :data="posts" @pagination-change-page="page => getPosts(page, selectedCategory)" />

There is no selectedCategory anymore.

avatar

Yeah, good catch, it should be search_category instead now.

avatar
You can use Markdown
avatar

Hello, what about use https://datatables.net/ in vue as a server-side, I used it but in jquey blade or js file.. in vue How??

avatar

For vue, there are specific packages, a lot of them, google "vue datatables"

avatar

yes I know but think not server side..thanks for reply

avatar
You can use Markdown
avatar

DRY

const filters = [
	'category',
	'id',
	'title',
	'content',
	'global'
]

filters.forEach(filter => {
	watch(eval(`search_${filter}`), (current, previous) => {
		getPosts(
			1,
			search_category.value,
			search_id.value,
			search_title.value,
			search_content.value,
			search_global.value,
			orderColumn.value,
			orderDirection.value
		)
	})
})

I don't remember if I commented on it in a fresher course

avatar
You can use Markdown
avatar
You can use Markdown