Unknown problems introduced by import

test.js

import store from "./store"
import config from "./../config/config"
import routes from "./../../router/index"
let saveData = store.fetch()
console.log(store)  // 
console.log(config)  // 
console.log(routes)  // undefined

ask the great god for advice!

= supplement =

router/index.js is as follows

import Vue from "vue"
import Router from "vue-router"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "/",
      name: "login",
      component: require("@/components/Login/login").default
    },
    {
      path: "/admin",
      name: "admin",
      component: require("@/components/Admin/app").default
    },
    {
      path: "*",
      redirect: "/"
    }
  ]
})

= add 2.16 =
actually my purpose is to call router.push in test.js to jump.
test.js is in the modules directory

clipboard.png

Jun.20,2022

introduce undefined just because you can't find the file, or there is no export in that file


introduces the path problem, and why do you add a. /? just import routes from'.. /.. / router'.


import routes from'. /.. /.. / router/index'
remove'/ index' or write as'/ index.js'


 component: require('@/components/Admin/app').default

 require
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4d9e0-44787.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4d9e0-44787.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?