Closed jvik closed 5 years ago
Shouldn't plain javascript be supported by typescript? What issues are you having?
Could not find a declaration file for module 'vue-router-back-button'. '/Users/jvik/project/node_modules/vue-router-back-button/dist/index.js' implicitly has an 'any' type.
Try `npm install @types/vue-router-back-button` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-router-back-button';`
TS Errors like this when importing
You can use the follow syntax for now:
import Vue from 'vue';
import Router from 'vue-router';
const VueRouterBackButton = require('vue-router-back-button');
Vue.use(Router);
Vue.use(VueRouterBackButton.routerHistory);
const router = new Router({
routes: [
//
],
});
router.afterEach(VueRouterBackButton.writeHistory);
export default router;
Any plans on implementing typescript types for this package?