Closed ice-2022 closed 7 years ago
Can you give us some more info?
What OS, node version, etc.
Does it happen when you click on the tables page or after you perform a certain action?
windows7 and my node version is v6.10.2
it happen when i load page without any action
I run the code below:
import $ from 'jquery'
// Require needed datatables modules
import 'datatables.net'
import 'datatables.net-bs'
export default {
name: 'Tables',
mounted () {
this.$nextTick(() => {
console.log($)
console.log($.DataTable)
$('#example1').DataTable()
})
}
}
the result is: object undefined
Please reference Euvl's comments on this. https://github.com/misterGF/CoPilot/issues/22
@misterGF I have the same problem,how to fix it?
[Vue warn]: Error in nextTick: "TypeError: $(...).DataTable is not a function"
import $ from 'jquery'
// Require needed datatables modules
import 'datatables.net'
import dataTable from 'datatables.net-bs'
export default {
name: 'User',
mounted () {
this.$nextTick(() => {
$.fn.DataTable = dataTable // <----- add this line
$('#example1').DataTable()
})
}
}
it work!
TypeError: (0 , _jquery2.default)(...).DataTable is not a function at VueComponent.eval (eval at (app.js:1734), :21:42)
at Array.eval (eval at (app.js:612), :511:20)
at nextTickHandler (eval at (app.js:612), :460:16)