0
votes

I one file I have a component registered like this (/tables/mytable.ts):

import Vue from "vue";

Vue.component('my-table', {
  template: "<p>mycomponent</p>"
});

I second file I want to use my component (myvue.ts):

import Vue from "vue";

// these two ways bellow don't working too
//import myTable from 'my-table'
//import { MyComponent } from '/tables/mytable.ts';

let v = new Vue({
  el: "#tabForUsers",
  template: "<my-table></my-table>"
});

I get error:

Unknown custom element: <my-table> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

In webpack I have every ts file separately.

Can you try just import './tables/mytable.ts'?Explosion Pills
When I add ./ I get error: An import path cannot end with a '.ts' extension, when I remove .ts I get error: Cannot find moduleRobert
Sorry, try './tables/mytables'Explosion Pills
When I remove .ts I get error: Cannot find module. Maybe the problem is that in webpacka I have every file separately? Maybe mytables.ts and myvue.ts should be in the same file ?Robert
I resolved this issue, I had to take all ts files into one entry in webpack,but only these files that belongs to one view, and next group of ts files that belongs to another view have to be in the next entry output: entry: 'aaa': ['1.ts', '2.ts','3.ts'] , 'bbb': ['4.ts','5.ts','6.ts'] etc, and I don't need use import './tables/mytables'Robert