TS4023: Exported Variable has or is using name from external module but cannot be named

后端 未结 3 828
有刺的猬
有刺的猬 2021-02-04 03:18

I\'ve seen this answered before, but they don\'t seem to cover this specific use case (or they don\'t work/help)

import {Route} from \'vue-router\';


export con         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 04:11

    Apparently this is the solution to my problem:

      import {Route, RouteConfig} from 'vue-router';
    
    
      export const detailRoute: RouteConfig = {
        path: '/detail/:id',
        component: Detail,
        props: (route: Route) => ({
          state: route.query.state
        })
      };
    

    Specifying that detailRoute was a RouteConfig (which in turn uses Route) solved the problem. I must have misunderstood how this is supposed to work, but this fixed it.

提交回复
热议问题