Jibin Mathew
Jibin Mathew

Reputation: 5102

Use predefined vue.js directive with custom directive

Suppose I have a custom directive that fetches an array result from certain location , How could I possibly use v-repeat alongside my directive internally rather than separately calling v-repeat externally.

Upvotes: 3

Views: 1072

Answers (1)

David K. Hess
David K. Hess

Reputation: 17246

In Vue, you normally use directives (http://vuejs.org/guide/index.html#Directives) to modify the behavior of an existing DOM element. The behavior you are describing is more suited to a component (http://vuejs.org/guide/index.html#Components).

You would declare a component with a template attribute that either inline or via reference to a <script> style template would have markup that would include usage of v-repeat.

Upvotes: 1

Related Questions