Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vue-active-admin) #272

Merged
merged 5 commits into from
Feb 28, 2020
Merged

feat(vue-active-admin) #272

merged 5 commits into from
Feb 28, 2020

Conversation

LuisFros
Copy link
Contributor

@LuisFros LuisFros commented Feb 28, 2020

This project supports Vue inside ActiveAdmin

  • The main package is located in app/javascript/packs/admin_application.js, here you will declare the components you want to include in your ActiveAdmin views as you would in a normal Vue App.
  • Additionally, to be able to use Vue components as Arbre Nodes the component names are also declared in config/initializers/active_admin.rb
  • The generator includes an example component called admin_component, you can use this component inside any ActiveAdmin view by just writing admin_component as you would with any html tag.
    • For example:
       admin_component(class:"myCustomClass",id:"myCustomId") do
       	admin_component(id:"otherCustomId")
       end
      
    • (Keep in mind that the example works with ruby blocks because AdminComponent has a <slot> tag defined, therefore children can be added to the component)
  • The integration supports passing props to the components and converts them to their corresponing javascript objects.
    • For example, the following works
     admin_component(test_list:[1,2,3,4],test_object:{"name":"Vue component"})
    
    • You can also use any vue bindings such as v-for , :key etc.

@LuisFros LuisFros requested a review from ldlsegovia February 28, 2020 17:47
@LuisFros LuisFros force-pushed the feat-vue-active-admin branch from 6a47ab4 to 1dac9e6 Compare February 28, 2020 17:49
Copy link
Collaborator

@ldlsegovia ldlsegovia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se ve super! una cosita nada más

@LuisFros LuisFros force-pushed the feat-vue-active-admin branch from 3ae1d72 to ab0970f Compare February 28, 2020 20:39
@LuisFros LuisFros force-pushed the feat-vue-active-admin branch from ab0970f to cd9e0d7 Compare February 28, 2020 20:47
@LuisFros LuisFros merged commit 2da47f9 into master Feb 28, 2020
@LuisFros LuisFros deleted the feat-vue-active-admin branch February 28, 2020 21:01
module AdminPageLayoutOverride
def build_page(*args)
within head do
text_node(javascript_packs_with_chunks_tag('admin_application'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

troesma le faltó el helper de stylesheet pack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants