Complete Vue.js 2 Web Development_ Practical guide to building end-to-end web development solutions with Vue.js 2

(singke) #1
Large Application Patterns with Vuex Chapter 18

<script>
/* eslint-disable no-unused-vars */
const a = `

Leave an open back tick at the last line because we have to bloat the file with a lot of useless
data. Save and close Massive.vue.


In a console, go to the same directory where the file is stored and use the following file to


put a lot of garbage into it:


yes "XXX" | head -n $((10**6)) >> Massive.vue

What this command does is append the XXX line to the file repeatedly 10^6 times; this will


add 4 million bytes to the file, making it too huge for a fast browsing experience.


Now we need to close the back tick we opened. Don't try to open the file now, as your text


editor may not be capable of opening such a big file; instead, use the following command:


echo '`</script>' >> Massive.vue

Our Massive component is now complete.


Open the index.js inside the router folder and add the component and its route:


import Massive from '@/components/Massive'
...
export default new Router({
routes: [
{
path: '/',
name: 'Hello',
component: Hello
},
{
path: '/massive',
name: 'Massive',
component: Massive
}
]
})
Free download pdf