mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
28 lines
860 B
JavaScript
28 lines
860 B
JavaScript
export const messages = [
|
|
{ component: 'vText', data: 'Welcome to the <b>Dynamic Component</b> demo!' },
|
|
{ component: 'vImage', data: 'https://placeimg.com/350/200/animals' },
|
|
{ component: 'vCode', data: 'var a = 1;\nvar b = 2;\nb = a;' },
|
|
{
|
|
component: 'vChart',
|
|
data: {
|
|
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
datasets: [
|
|
{
|
|
label: 'Activity',
|
|
backgroundColor: '#41b883',
|
|
data: [40, 20, 12, 39, 10, 40, 39, 50, 40, 20, 12, 11]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{ component: 'vText', data: 'End of demo 🎉' }
|
|
]
|
|
|
|
async function streamMessages (fn, i = 0) {
|
|
if (i >= messages.length) { return }
|
|
await fn(messages[i])
|
|
setTimeout(() => streamMessages(fn, i + 1), 1500)
|
|
}
|
|
|
|
export default streamMessages
|