Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. var vm = new Vue({
  2. el: '#app',
  3. data: {
  4. colors: [
  5. {name: "red", colorCode: ["#ff0000", "#aa0000", "#770000"] },
  6. {name: "green", colorCode: ["#00ff00", "#00aa00", "#007700"] },
  7. {name: "blue", colorCode: ["#0000ff", "#0000aa", "#000077"] }
  8. ]
  9. },
  10. partials: {
  11. tpl_color: '<li>{{$parent.name}} : {{color}} ({{$index + 1}})</li>'
  12. },
  13. template: '<template v-repeat="colors">' +
  14. '<p>{{name}}</p>' +
  15. '<ul v-repeat="color: colorCode">' +
  16. '{{> tpl_color}}' +
  17. '</ul>' +
  18. '</template>'
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement