Tarek Adam
Tarek Adam

Reputation: 3525

What can I access with vue2 beforeCreate?

I'd like to access props or <tag data-att="info I need">, but that doesn't seem possible in beforeCreate. So, what do I have access to in beforeCreate?

Upvotes: 0

Views: 1422

Answers (1)

Simon Thiel
Simon Thiel

Reputation: 3285

beforeCreate() is called synchronously immediately after the instance has been initialized, before data observation and event/watcher setup. (See docs: https://v2.vuejs.org/v2/api/#beforeCreate)

You can only access the component's props and this.$options (the options object you defined for this component)

Upvotes: 1

Related Questions