Good day,
I have recently created an npm package for a navigation-bar which I want to import into my main codebase. I am using vue @components and I can't quite find out how to use the imported component. If anyone knows how to get the npm packaged component into the dom, your help would be greatly appreciated.
Below is a simplified example of what I have tried:
npm package
import Vue from 'vue';
import Component from 'vue-class-component';
import '../navigation-bar.styles.less';
@Component({template: require('../navigation-bar.html')}})
export class NavigationBar extends Vue {
constructor() {
super();
}
}
Vue.component('navigation-bar', NavigationBar);
main.ts
import { NavigationBar } from '@international-client/navigation-bar';
Vue.component('navigation-bar', NavigationBar);
index.html
<html>
<head>
<title>Game</title>
</head>
<navigation-bar></navigation-bar>
<body class="game-view">
</body>
</html>