Merge branch 'master' of github.com:tainacan/tainacan

This commit is contained in:
Jacson Passold 2017-12-20 22:15:09 -02:00
commit c89a5743a5
2 changed files with 9 additions and 1 deletions

View File

@ -30,11 +30,14 @@ class DevInterface {
function add_admin_js() {
global $TAINACAN_BASE_URL;
$components = ( has_filter( 'tainacan_register_web_components' ) ) ? apply_filters('tainacan_register_web_components') : [];
wp_enqueue_script('wp-settings',$TAINACAN_BASE_URL . '/js/wp-settings.js');
$settings = [
'root' => esc_url_raw( rest_url() ).'tainacan/v2',
'nonce' => wp_create_nonce( 'wp_rest' )
'nonce' => wp_create_nonce( 'wp_rest' ),
'components' => $components
];
wp_localize_script( 'wp-settings', 'wp_settings', $settings );

View File

@ -7,6 +7,11 @@ export const eventBus = new Vue({
componentsTag: [],
errors : store.getters['item/getError']
},
created(){
if( wp_settings.components ){
this.componentsTag = wp_settings.components;
}
},
methods : {
registerComponent( name ){
this.componentsTag.push( name );