Home  >  Q&A  >  body text

How to use the created hook in the setup script

<p><pre class="brush:php;toolbar:false;"><script> export default { setup() { } created() { } } </script></pre> <p>How do I use the hook I created when I change to using script settings syntax? </p> <pre class="brush:php;toolbar:false;"><setup script> // how to use created hook? </script></pre></p>
P粉549412038P粉549412038393 days ago498

reply all(1)I'll reply

  • P粉787806024

    P粉7878060242023-08-26 00:11:27

    As you can see here, there is no such thing as "create" in the Composition API lifecycle: https://vuejs.org/api/composition-api-lifecycle.html

    Because it happens before actual creation

    created The hook follows as follows: https://vuejs.org/guide/essentials/lifecycle.html#lifecycle-diagram

    reply
    0
  • Cancelreply