Hello there,
I recently developed my own npm package for a navigation bar and I need to incorporate it into my main codebase. Currently, I am utilizing vue @components but I am struggling with integrating the imported component. If anyone has insight on how to properly include the npm packaged component in the DOM, your assistance would be highly valued.
Here is a simplified demonstration of what I have attempted:
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>