Closed johnsoncodehk closed 3 years ago
When using Composition API, there is no need to write .value which will make the code much cleaner.
.value
For this code:
<template> <button @click="inc">{{ count }}</button> <p v-if="done">done!</p> </template> <script setup> import { ref, computed } from 'vue' export const count = ref(0) export const done = computed(() => count.value > 100) export const inc = () => count.value++ console.log(done.value) </script>
When use no-ref, the <script> can replace to
no-ref
<script>
<script setup noref> export let count = 0 // @ref export const done = count > 100 // @computed export const inc = () => count++ console.log(done) </script>
Rendered: 中文 | English
Close because we are looking for a better way.
Hello, in my opinion, this proposal is very good. Why is it closed? Can you help me with this? Thank you very much.
When using Composition API, there is no need to write
.value
which will make the code much cleaner.Transform Sample
For this code:
When use
no-ref
, the<script>
can replace toRendered: 中文 | English