diff --git a/src/AppCodeHighlight.js b/src/AppCodeHighlight.js index 1b3675194..84230a53a 100644 --- a/src/AppCodeHighlight.js +++ b/src/AppCodeHighlight.js @@ -1,6 +1,6 @@ import Prism from 'prismjs'; -const CodeHighlight2 = { +const CodeHighlight = { beforeMount(el, binding) { if (binding.modifiers.script) el.className = 'language-javascript'; @@ -13,4 +13,4 @@ const CodeHighlight2 = { } }; -export default CodeHighlight2; \ No newline at end of file +export default CodeHighlight; \ No newline at end of file diff --git a/src/main.js b/src/main.js index ff99da4e7..df22e691e 100644 --- a/src/main.js +++ b/src/main.js @@ -76,9 +76,8 @@ import ToggleButton from './components/togglebutton/ToggleButton'; import TriStateCheckbox from './components/tristatecheckbox/TriStateCheckbox'; import Galleria from './components/galleria/Galleria'; -import CodeHighlight from './views/codehighlight/CodeHighlight'; import AppInputStyleSwitch from './AppInputStyleSwitch'; -import CodeHighlight2 from './AppCodeHighlight'; +import CodeHighlight from './AppCodeHighlight'; import './assets/styles/primevue.css'; import 'primeflex/primeflex.css'; @@ -104,7 +103,6 @@ app.use(router); app.directive('tooltip', Tooltip); app.directive('ripple', Ripple); -app.directive('code', CodeHighlight2); app.component('Accordion', Accordion); app.component('AccordionTab', AccordionTab); @@ -177,7 +175,7 @@ app.component('TreeTable', TreeTable); app.component('TriStateCheckbox', TriStateCheckbox); app.component('Galleria', Galleria); -app.component('CodeHighlight', CodeHighlight); app.component('AppInputStyleSwitch', AppInputStyleSwitch); +app.directive('code', CodeHighlight); app.mount('#app'); \ No newline at end of file diff --git a/src/views/accordion/AccordionDoc.vue b/src/views/accordion/AccordionDoc.vue index 5c9ad2b9b..819b8f462 100755 --- a/src/views/accordion/AccordionDoc.vue +++ b/src/views/accordion/AccordionDoc.vue @@ -390,7 +390,6 @@ export default { </AccordionTab> </Accordion> -
diff --git a/src/views/autocomplete/AutoCompleteDoc.vue b/src/views/autocomplete/AutoCompleteDoc.vue
index a061a71a0..67d3f32a3 100755
--- a/src/views/autocomplete/AutoCompleteDoc.vue
+++ b/src/views/autocomplete/AutoCompleteDoc.vue
@@ -3,17 +3,22 @@
 		
 			
 				
Import
- +
+
 import AutoComplete from 'primevue/autocomplete';
-
+
+
Getting Started

AutoComplete uses v-model for two-way binding, requires a list of suggestions and a complete method to query for the results. The complete method gets the query text as event.query property and should update the suggestions with the search results. Example below connects to a remote datasource to fetch the results;

- +
+
 <AutoComplete v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountry($event)" field="name" />
-
-
+
+
+
+
 export default {
 	data() {
 		return {
@@ -31,35 +36,42 @@ export default {
 		}
 	}
 }
-
+
+
Dropdown

Enabling dropdown property displays a button next to the input field where click behavior of the button is defined using dropdownMode property that takes "blank" or "current" as possible values. "blank" is the default mode to send a query with an empty string whereas "current" setting sends a query with the current value of the input.

- +
+
 <AutoComplete v-model="brand" :dropdown="true" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" />
-
+
+
Multiple Mode

Multiple mode is enabled using multiple property to select more than one value from the autocomplete. In this case, value reference should be an array.

- +
+
 <AutoComplete :multiple="true" v-model="selectedCountries" :suggestions="filteredCountriesMultiple" @complete="searchCountryMultiple($event)" field="name" />
-
+
+
Objects

AutoComplete can also work with objects using the field property that defines the label to display as a suggestion. The value passed to the model would still be the object instance of a suggestion. Here is an example with a Country object that has name and code fields such as {name:"United States",code:"USA"}.

- +
+
 <AutoComplete field="label" v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountryBasic($event)" />
-
+
+
Templating

Item template allows displaying custom content inside the suggestions panel. The slotProps variable passed to the template provides an item property to represent an item in the suggestions collection.

- -