【发布时间】:2021-07-19 01:34:16
【问题描述】:
我正在使用 laravel 惯性和 vuejs 为我的表格创建一个搜索框。我在 vue 的方法函数中使用 this.$inertia.get("/member", { term: this.term }); 时遇到问题,因为它会清除我的搜索框。当我尝试使用 this.$inertia.replace(this.route("member.index", { term: this.term })); 替换上面的代码时,它说替换已被贬值。
这是我的完整代码。
从我的搜索输入类型:
<input
type="text"
name="table_search"
class="form-control float-right"
placeholder="Search"
v-model="term"
@keyup="search"
/>
还有我的脚本:
export default {
props: {
members: Object,
filters: Object,
},
data() {
return {
term: "",
};
},
components: {
AppLayout,
Paginator,
},
methods: {
search() {
// this.$inertia.replace(this.route("member.index", { term: this.term }));
this.$inertia.get("/member", { term: this.term });
},
},
};
</script>
【问题讨论】:
标签: vue.js search laravel-8 inertiajs