Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 2.42 KB

File metadata and controls

31 lines (21 loc) · 2.42 KB

writable-computed easy #Composition API #Reactivity:Core

By webfansplz @webfansplz

Take the Challenge    简体中文

For this challenge, you will need to create a writable computed ref :

<script setup lang="ts">
import { ref, computed } from "vue"

const count = ref(1)
const plusOne = computed(() => count.value + 1)

/**
 * Make the `plusOne` writable.
 * So that we can get the result `plusOne` to be 3, and `count` to be 2.
*/

plusOne.value++

</script>

<template>
  <div>
    <p>{{ count }}</p>
    <p>{{ plusOne }}</p>
  </div>
</template>

Back Share your Solutions Check out Solutions