Skip to content

Commit f54aa47

Browse files
authored
feat(AppDataSearch): add customizable placeholder prop
### Summary This PR introduces a `placeholder` prop to the `AppDataSearch` component, allowing consumers to define custom placeholder text instead of using the hardcoded "Search". ### Changes - Added `placeholder` prop with default value `"Search"` - Updated template to use `:placeholder="placeholder"` instead of `__('Search')` - Maintains backward compatibility (defaults to `"Search"` if no prop is passed) ### Usage Example ```vue <AppDataSearch :url="route('student.index')" fields-to-search="name" placeholder="Search by student name" ></AppDataSearch>
1 parent 9a8e8b5 commit f54aa47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stubs/resources/js/Components/DataTable/AppDataSearch.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AppInputText
99
id="search"
1010
v-model="searchTerm"
11-
:placeholder="__('Search')"
11+
:placeholder="placeholder"
1212
name="search"
1313
class="w-full py-2 pl-9 md:w-1/2"
1414
></AppInputText>
@@ -39,6 +39,10 @@ const props = defineProps({
3939
additionalParams: {
4040
type: Object,
4141
default: () => {}
42+
},
43+
placeholder: {
44+
type: String,
45+
default: 'Search'
4246
}
4347
})
4448

0 commit comments

Comments
 (0)