ratiw / vuetable-2

data table simplify! -- datatable component for Vue 2.x. See documentation at
https://vuetable.com
MIT License
2.16k stars 399 forks source link

ERROR in ./~/vue-tables-2/lib/methods/render.js #36

Closed JakePerillano closed 7 years ago

JakePerillano commented 7 years ago

Hi @ratiw still a newbie of using vue, and been trying your vuetable but I encountering some parse error.

Module parse failed: C:\xampp\htdocs\ProjectLaravel\PROJ\node_modules\vue-tables-2\lib\methods\render.js Unexpected token (17:9)

Here is my webpack.config.js `var webpack = require('webpack');

var fileName = "list.js"; //source and compiled filename var entryFile = "./public/js/Core/"+fileName; var destinationFolder = "./public/js/Core/compiled";

module.exports = { entry: entryFile,

output: {
    path: destinationFolder,
    filename: fileName
},

module: {
    loaders: [
        {
            test: /\.jsx$/,
            loader: 'babel-loader'
        },

        {
            test: /\.js$/,
            loader: 'babel-loader',
            exclude: /node_modules/
        },

        {
            test: /\.jsx?$/,
            loader: 'babel-loader',
            exclude: /node_modules(?!\/(vue-tables-2|vue-pagination-2))/
        }
    ]
},

resolve: {
  alias: {
    'vue$': 'vue/dist/vue.common.js'
  }
}

}; `

And my JS file `var VueTables = require('vue-tables-2');

Vue.use(VueTables.client, { compileTemplates: true, highlightMatches: true, pagination: { dropdown:true, chunk:5 }, filterByColumn: true, texts: { filter: "Search:" }, datepickerOptions: { showDropdowns: true } });

new Vue({ el : '#brandVue',

data : {
    columns: ['id','name','age'],
    tableData: [
        {id:1, name:"John",age:"20"},
        {id:2, name:"Jane",age:"24"},
        {id:3, name:"Susan",age:"16"},
        {id:4, name:"Chris",age:"55"},
        {id:5, name:"Dan",age:"40"}
    ],
}

}); `

Thanks @ratiw for the help!

ratiw commented 7 years ago

@JakePerillano I think you might need to post it here.

JakePerillano commented 7 years ago

Hi @ratiw! Thanks for replying, can I ask another question?

What if i am importing my components from a different folder let say outside the current location of my main.js? would that be possible?

Many thanks!

ratiw commented 7 years ago

Of course, that totally possible. You just have to use relative path to access that folder.