import Header from '@/components/header.vue';
The above code report can’t find the module. It’s OK to write the relative path, but it’s not OK to configure alias in webpack
//That's OK
import Header from '../../components/header.vue';
Ask the great God to tell why?,Except inwebpack
In addition to the configurationtsconfig.json
Configuration in the file
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@": ["src/components"]
}
}
Alias configuration
Write it in tsconfig