TS imports pages under the same path

TS imports pages under the same path. For example, if you have the following directory structure, if you want to use components pages/bbb/index.tsxin , how should you write the import statement?pages/bbb/my_test_sub.tsxMyTestSub

├── pages
│   ├── aaa 
│   ├── bbb   
│   │   ├── index.tsx   
│   │   └── my_test_sub.tsx // 假设里面有一个名为 MyTestSub 的组件

typo

import MyTestSub from '.';

The correct way to write it is to use an absolute path

import MyTestSub from '@/pages/bbb/my_test_sub';

Guess you like

Origin blog.csdn.net/qq_41767116/article/details/130498583