简体   繁体   中英

How can I use DataTable plugin with Laravel Vue.js project?

Currently, I am enhancing my Laravel application with Vue js. And I want to display the data in jQuery DataTable. Please, someone, suggest to me how to do this as I am new to Vue js. Much appreciated if someone could suggest me a good tutorial on this.Thank you.

See Here Install the package To install this package, simply install vuejs-datatable with your favorite package manager:

npm install vuejs-datatable
yarn add vuejs-datatable

Import & register the DatatableFactory in Vue:

import Vue from 'vue';
import { VuejsDatatableFactory } from 'vuejs-datatable';

Vue.use( VuejsDatatableFactory );

In your HTML, load the IIFE build directly, if possible right before the closing tag. You must make sure that the loading order is preserved, like below.

<body>
    <!-- All your page content... -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.js" defer></script> 
    <script src="/dist/vuejs-datatable.js" defer></script> 
    <script src="/myscript.js" defer></script> 
</body>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM