Answer the question
In order to leave comments, you need to log in
Can't find ts module. vue?
Hello, there was an error about types in TS:
property '$error' does not exist on type 'CombinedVueInstance<Vue, { email: string; password: string; }, { onSubmit(): void; }, unknown, Readonly<Record
Failed to compile.
./src/main.ts
Module not found: Error: Can't resolve './token-service' in 'D:\__my_prog\vue\crm\src'
import Vue from 'vue'
import TokenService from '../path/to/token-service'
declare module 'vue/types/vue' {
interface Vue {
$message(html: string) : any
$error(html: string) : any
}
}
import M from 'materialize-css'
export default {
install(Vue, options) {
Vue.prototype.$message = function (html: string): any {
M.toast({html})
}
Vue.prototype.$error = function(html: string): any {
M.toast({html: `[Ошибка]: ${html}`})
}
}
}
import Vue from "vue";
import Vuelidate from 'vuelidate'
import App from "./App.vue";
import "./registerServiceWorker";
import router from "./router";
import store from "./store";
import dateFilter from "./filters/date.filter";
import messagePlugin from "./utils/message.plugin"
import './token-service'
Vue.config.productionTip = false;
Vue.use(messagePlugin)
Vue.use(Vuelidate as any)
Vue.filter('date', dateFilter)
new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question