<div id="app">
{{ total }}
</div>
.red {
padding: 1rem;
border: 3px solid red
}
const { createApp, ref, computed } = Vue;
const app = createApp({
setup() {
const num1 = ref(2);
const total = computed(() => num1.value * 2)
return {
total
}
}
});
app.mount('#app');
This Pen doesn't use any external CSS resources.