Practical guides, tutorials, and insights from years of building web and desktop applications. Check out code examples you can actually use!
Make an object non-reactive in Vue
Are you tired of Vue reactivity? Do you long for days when you had to manually refresh HTML pages to see changes? Or, do you have large objects and reactivity is killing your app? Vue has the answer. Vue enables this magic to respond to any changes in state on the UI. You can just declare variables in a component, and low and behold - they are reactive. <script> export default { data() { return { accounts:[], }; }, mutations: { setAccounts(state, accounts) { state.accounts = accounts }, addAccount(state, account) { state.accounts.push(account); } }; } </script> In the above example, accounts is reactive. Any changes to accounts is reflected on the UI without needing any other changes or logic. ...