If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).
Example below explains implications for different implementations.
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| //CSS | |
| //defining the options | |
| var option1 = 1 | |
| var option2 = 2 | |
| var option3 = 3 | |
| //initiating the contacts object in an array | |
| var contacts = [ | |
| { | |
| firstname: "John", | |
| lastname: "smith", |
| {}, | |
| "postcss": { | |
| "plugins": { | |
| "autoprefixer": {} | |
| } | |
| }, | |
| {} |
| module.exports = { | |
| "plugins": [ | |
| require('tailwindcss')('tailwind.js'), | |
| require('autoprefixer')(), | |
| ] | |
| } |
| <div class=" container mx-auto py-10"> | |
| <div class="border m-6 rounded-lg bg-white mx-auto max-w-sm shadow-lg rounded-lg overflow-hidden"> | |
| <div class="sm:flex sm:items-center px-6 py-4"> | |
| <img class="block h-16 sm:h-24 rounded-full mx-auto mb-4 sm:mb-0 sm:mr-4 sm:ml-0" src="https://api.adorable.io/avatars/196/[email protected]" alt=""> | |
| <div class="text-center sm:text-left sm:flex-grow"> | |
| <div class="mb-4"> | |
| <p class="text-xl leading-tight">Jane Doe</p> | |
| <p class="text-sm leading-tight text-grey-dark">Software Developer at SpongeBob LLC.</p> | |
| </div> | |
| <div class="flex flex-wrap"> |
| <html> | |
| <head> | |
| <title>Responsive Gallery<title> | |
| <!--links to the stylesheet--> | |
| <link rel="stylesheet" type="text/css" href="styles.css"> | |
| </head> | |
| <body> | |
| <!-- class of 'container' holds other items (sub classes)--> | |
| <div class='container'> | |
| <div><img src=''/></div> |