Enable Vue.js for Hawksearch box widget
In this article you will find:
- 1.1 Overview
- 1.2 Goal
- 1.3 Prerequisite
- 2 Steps for setup
Overview
The Hawksearch Box using Vue.js provides framework-specific integration of the search field and enables an optimized and efficient way of using the widget.
Goal
This document provides information on setting up the Hawksearch box widget using Vue.js. Basic usage is covered in Getting started and any additional information may be found there.
Prerequisite
Configured Hawksearch box widget.
Steps for setup
Open the selected widget template file
Uncomment, if necessary, the part of the markup designated as Vue template. This should include a
div
element with attributedata-component="vue-app-searchbox"
. In it, there should be a Vue component namedsearch-box
. Comment the part marked as React template. Only this step is required for enabling the component, the rest of the steps are optional.Modify the
data-client-guid
attribute to set the Hawksearch client ID.Modify the
data-hawksearch-base-api
attribute to set the Base API URL.Modify the
data-hawksearch-search-api
attribute to set the Search API URLModify the
data-json-params
attribute (JSON object, param_name: param_value) to set additional search parameters, specific for the widget instance.Modify the
data-index-name
attribute to set index for the widget search requests.Edit the HTML structure around
<search-box>
to set the desired layout. The existing classes are used for the built-in theme.Modify the
search-page
attribute in<search-box>
to set the redirect page.Save, re-build and refresh the page.
Â