Method: VueGenerator#vue

Defined in:
lib/generators/vue/vue_generator.rb

#vueObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/generators/vue/vue_generator.rb', line 32

def vue
  return if name.empty?

  if options[:child] 
    adding_nested_component(:child, name, nil, options[:child])
  elsif options[:parent]
    adding_nested_component(:parent, name, options[:parent], nil)
  else 
    if options[:seperate]
      if options[:turbolinks]
        add_to_component("turbolinks_seperate", name)
      else 
        add_to_component("seperate", name)
      end
    else 
      if options[:turbolinks]
        add_to_component("turbolinks_single", name)
      else 
        add_to_component("single", name)
      end
    end
  end

  OPTIONS.each do |each_option, value| 
    if each_option == :form
      options[:form] ? add_form_to_component(ARGV, each_option, name) : nil
    else
      options[each_option] ? add_to_component(each_option, name) : nil
    end
  end
end