JSFiddle - React, Tailwind, and code Playground
by mattoconnell408
HTML
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id='app'>
<p>{{str}}</p>
<p>{{obj.str2}}</p>
<p v-for="item in arr">{{item}}</p>
</div>
JavaScript
const obj = {
str: 'This wont update',
str2: 'This will!'
};
const arr = ['this will change'];
const app = new Vue({
el: '#app',
data: {
str: obj.str,
obj: obj,
arr: arr,
arrItem: arr[0]
}
})
setInterval(() => {
obj.str += '?';
obj.str2 += '!';
arr.push(arr.length + 1);
arr[0] = 'something new';
}, 1000);