add basic support for multiple imports
This commit is contained in:
@@ -28,8 +28,20 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.content = require(`!!raw-loader!~/components/${this.path}`).default
|
||||
this.component = require(`~/components/${this.path}`).default
|
||||
const files = require.context(`~/demos/`, true)
|
||||
.keys()
|
||||
.filter(path => path.startsWith(`./${this.path}`))
|
||||
.filter(path => path.endsWith('.vue') || path.endsWith('.js') || path.endsWith('.css'))
|
||||
.map(path => path.replace('./', ''))
|
||||
.map(path => ({
|
||||
path: path.replace(`${this.path}/`, ''),
|
||||
content: require(`!!raw-loader!~/demos/${path}`).default
|
||||
}))
|
||||
|
||||
console.log(files)
|
||||
|
||||
// this.content = require(`!!raw-loader!~/components/${this.path}`).default
|
||||
// this.component = require(`~/components/${this.path}`).default
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user