Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 5 column 16
---
title: Refactor `sw-simple-search-field` component to transparent wrapper
issue: NEXT-16271
author: Raoul Kramer
author_email: [email protected]
author_github: @djpogo
---
- Deprecated custom
model
definition onsw-simple-search-field
component frommodel: { prop: 'searchTerm', event: 'search-term-change' }
to not debounced default handling@input
andvalue
property. - Deprecated
searchTerm
property onsw-simple-search-field
with version 6.5.0, usevalue
instead. - Deprecated
watch: { term() { … }
onsw-card-filter
component. - Added
onSearchTermChange()
method onsw-card-filter
component to replace deprecatedterm
watcher. - Deprecated
watch: { searchTerm() { … }
onsw-product-stream-grid-preview
component. - Added
onSearchTermChange()
method onsw-product-stream-grid-preview
component to replace depreactedsearchTerm
watcher. - Deprecated
watch: { searchTerm() { … }
onsw-media-field
component. - Added
onSearchTermChange()
method onsw-media-field
component to replace deprecatedsearchTerm
watcher. - Deprecated
watch: { term() { … }
onsw-sidebar-media-item
component. - Added
onSearchTermChange()
method onsw-sidebar-media-item
component to replace deprecatedterm
watcher. - Deprecated
watch: { 'term'() { … }
onsw-product-variants-configurator-prices
component. - Added
onSearchTermChange()
method onsw-product-variants-configurator-prices
component to replace deprecated'term'()
watcher. - Deprecated
watch: { searchTerm() { … }
onsw-product-stream-modal-preview
component. - Added
onSearchTermChange()
method onsw-product-stream-modal-preview
component to replace deprecatedsearchTerm
watcher. - Deprecated
watch: { searchTerm() { … }
onsw-sales-channel-product-assignment-categories
component. - Added
onSearchTermChange()
method onsw-sales-channel-product-assignment-categories
component to replace deprecatedsearchTerm
watcher. - Deprecated
watch: { term() { … }
onsw-custom-field-list
component. - Added
onSearchTermChange()
method onsw-custom-field-list
component to replace deprecatedterm
watcher. - Added
doSearch
method onsw-settings-product-feature-sets-values-card
component to keep concerns better seperated, between@search-term-change
handler and multiple used search code.
The custom model
definition is deprecated:
model: {
prop: 'searchTerm',
event: 'search-term-change',
},
The component uses now standard vue model behavior. A v-model
binding is now instantly and not debounced. If you watch
on the v-model
value you should switch your code to listen at @search-term-change
.
The v-model
is not debounced anymore. If you use a watch
er you must switch your watch
code to a method and listen at the @search-term-change
event.
Before:
<sw-simple-search-field
v-model="term"
…
/>
// component code
data() {
return {
…
term: null,
};
},
…
watch: {
term() {
this.onSeach(this.term);
},
},
…
After:
<sw-simple-search-field
v-model="term"
@search-term-change="onSearchTermChange"
/>
// component code
data() {
return {
term: null,
};
},
…
methods: {
onSearchTermChange() {
this.onSearch(this.term);
},
},
…
Use value
property instead.
Before:
<sw-simple-search-field
…
:search-term="term"
…
/>
After:
<sw-simple-search-field
…
:value="term"
…
/>
nothing changes here.