a-virtual-table
Version:
The virtual scrolling component developed based on the Table component of Ant Design supports dynamic height and solves the problem of scrolling stuck when the amount of data is large.
31 lines (26 loc) • 523 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