mirror of https://github.com/vuejs/vitepress
parent
43469a2601
commit
19ec22cb40
@ -0,0 +1,5 @@
|
||||
<script setup>
|
||||
import { data } from './static.data.js'
|
||||
</script>
|
||||
|
||||
{{ data }}
|
@ -0,0 +1 @@
|
||||
{ "bar": true }
|
@ -0,0 +1 @@
|
||||
{ "foo": true }
|
@ -0,0 +1,20 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
export default {
|
||||
watch: ['./data/*'],
|
||||
async load() {
|
||||
const foo = fs.readFileSync(
|
||||
path.resolve(dirname, './data/foo.json'),
|
||||
'utf-8'
|
||||
)
|
||||
const bar = fs.readFileSync(
|
||||
path.resolve(dirname, './data/bar.json'),
|
||||
'utf-8'
|
||||
)
|
||||
return [JSON.parse(foo), JSON.parse(bar)]
|
||||
}
|
||||
}
|
Loading…
Reference in new issue