Using Webpack, which has properly built Vue and Element UI using both import and require. Running into issues with vue-data-tables, however.
When using the following:
import DataTables from 'vue-data-tables'
Vue.use(DataTables)
I get the error:
vue.js:4400
Uncaught TypeError: Cannot read property 'install' of undefined
at Function.Vue.use (vue.js:4400)
at Object._typeof2 (main.js:16)
at __webpack_require__ (bootstrap 21bdc8c1cd5b778aa7a2:19)
at _typeof (bootstrap 21bdc8c1cd5b778aa7a2:65)
at bootstrap 21bdc8c1cd5b778aa7a2:65
From vue.js, here're lines 4388 through 4408 (line 4400 marked with =>):
/* */
function initUse (Vue) {
Vue.use = function (plugin) {
var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
if (installedPlugins.indexOf(plugin) > -1) {
return this
}
// additional parameters
var args = toArray(arguments, 1);
args.unshift(this);
=>if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args);
} else if (typeof plugin === 'function') {
plugin.apply(null, args);
}
installedPlugins.push(plugin);
return this
};
}
If I change it to:
const DataTables = require('vue-data-tables');
Vue.use(DataTables);
I get:
Unknown custom element: <data-tables> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <Anonymous>
<Root>
So if I then declare the named component:
const DataTables = require('vue-data-tables');
Vue.use(DataTables);
Vue.component('data-tables', DataTables);
The console error is now:
Failed to mount component: template or render function not defined.
found in
---> <DataTables>
<Anonymous>
<Root>
Please advise. I'd like to take advantage of the functionality and work you've done, but I simply can't get it to work. Thank you.