el-table-virtual-scroll
Version:
The virtual scrolling component developed based on the Table component of Element-UI supports dynamic height and solves the problem of scrolling stuck when the amount of data is large.
30 lines (26 loc) • 522 B
JavaScript
import Vue from 'vue'
import Router from 'vue-router'
// 获取路由
function getRoutes () {
const files = require.context('./views', true, /\.vue$/, 'lazy')
return files.keys().map((path) => {
const name = path.replace(/^\.\/(.*)\.\w+$/, '$1')
return {
name,
path: '/' + name,
component: () => files(path)
}
}, {})
}
Vue.use(Router)
const routes = [
{
path: '/',
redirect: '/CaseDemo'
},
...getRoutes()
]
const router = new Router({
routes
})
export default router