notice(print_r($form, true)); $form['name']['#attributes'] += array( "v-model" => "mail", "@keyup.enter" => "login" ); $form['pass']['#attributes'] = array( "v-model" => "password", "@keyup.enter" => "login" ); $form['actions']['submit']['#attributes'] = array( "@click.prevent" => "login" ); } /** * implements hook_block_view_BASE_BLOCK_ID_alter() * * https://www.drupal.org/project/drupal/issues/2626224 */ function materio_user_block_view_user_login_block_alter(array &$build, BlockPluginInterface $block) { $build['#pre_render'][] = '_materio_user_user_login_block_pre_render'; } function _materio_user_user_login_block_pre_render(array $build){ $user_links = &$build['content']['user_links']; $items = &$user_links['#items']; // ksm($items); $items['create_account']['#url']->mergeOptions(array( "attributes" => array( "@click.prevent" => "create_account" ) )); $items['request_password']['#url']->mergeOptions(array( 'attributes' => array( "@click.prevent" => "request_password" ) )); return $build; }