Last active
May 20, 2023 17:14
-
-
Save nidhi-canopas/c1104be6f073de230c2eb3db24cfaa03 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <script> | |
| export default { | |
| setup() { | |
| console.log("I'm setup hook"); | |
| }, | |
| data() { | |
| console.log("I'm data hook"); | |
| return { | |
| stateOfBob: "sleeping", | |
| }; | |
| }, | |
| computed: { | |
| test: function () { | |
| return "I'm computed hook"; | |
| }, | |
| }, | |
| beforeCreate() { | |
| console.log("I'm beforeCreate hook"); | |
| console.log("Bob is currently ", this.stateOfBob); | |
| console.log("computed hook is returning ", this.test); | |
| }, | |
| }; | |
| </script> | |
| Output: | |
| I'm setup hook | |
| I'm beforeCreate hook | |
| Bob is currently undefined | |
| computed hook is returning undefined | |
| I'm data hook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment