<file_sep>// 导入组件，组件必须声明 name
import scroll from './scroll/index'
import scrollY from './scrollY/index'

// 以数组的结构保存组件，便于遍历
const components = [
  scroll,
  scrollY
]

export default components

<file_sep>import scrollY from './sm_scroll_y'
export default scrollY
<file_sep>import scroll from './sm_scroll'

export default scroll;
<file_sep>import { createRouter, createWebHashHistory } from 'vue-router'
import scroll from '@/demo/scroll'
import scrollY from "@/demo/scrollY";

const routes = [
  {
    path: '/scroll',
    name: 'scroll',
    component: scroll
  },
  {
    path: '/scrollY',
    name: 'scrollY',
    component: scrollY
  },
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
