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.
23 lines (18 loc) • 596 B
JavaScript
const fs = require('fs')
const path = require('path')
const demoDir = path.resolve(__dirname, '../src/views')
function buildDemoFiles () {
const files = fs.readdirSync(demoDir)
const jsonData = {}
files.forEach(function (fileName) {
const filePath = path.join(demoDir, fileName)
const stat = fs.statSync(filePath)
if (stat.isFile() && fileName.endsWith('.vue')) {
const name = fileName.replace(/.vue$/, '')
const data = fs.readFileSync(filePath, 'utf-8')
jsonData[name] = JSON.stringify(data)
}
})
return jsonData
}
module.exports = buildDemoFiles