-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
89 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,31 @@ | |
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
import { computed, ref } from 'vue' | ||
const alert = ref(true) | ||
const alertText = computed(() => alert.value ? 'Reset' : 'Show Alert') | ||
function reset () { | ||
alert.value = true | ||
} | ||
</script> | ||
|
||
<script> | ||
export default { | ||
data: () => ({ | ||
alert: true, | ||
alertText: 'Reset', | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
KaelWD
Author
Member
|
||
}), | ||
computed: { | ||
alertText () { | ||
return this.alert ? 'Reset' : 'Show Alert' | ||
}, | ||
}, | ||
methods: { | ||
reset () { | ||
this.alert = true | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is it a normal Vue usage to have both a data attribute + a computed prop with the same name ? @KaelWD