<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');

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/vue@3