Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 无法清除我的搜索输入类型_Vue.js_Search_Laravel 8_Inertiajs - Fatal编程技术网

Vue.js 无法清除我的搜索输入类型

Vue.js 无法清除我的搜索输入类型,vue.js,search,laravel-8,inertiajs,Vue.js,Search,Laravel 8,Inertiajs,我正在使用laravel inertia和vuejs为我的表格使用搜索框。我在使用this.$industry.get(“/member”,{term:this.term})时遇到问题在vue的my method函数中,因为它清除了我的搜索框。当我试图用this.$inderty.replace(this.route(“member.index”,{term:this.term})替换上面的代码时它表示替换已折旧 这是我的全部代码 从我的搜索输入类型: <input type=&q

我正在使用laravel inertia和vuejs为我的表格使用搜索框。我在使用
this.$industry.get(“/member”,{term:this.term})时遇到问题在vue的my method函数中,因为它清除了我的搜索框。当我试图用
this.$inderty.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>
导出默认值{
道具:{
成员:反对,
过滤器:对象,
},
数据(){
返回{
术语:“,
};
},
组成部分:{
申请退出,
分页器,
},
方法:{
搜索(){
//this.$inderty.replace(this.route(“member.index”,{term:this.term}));
this.$industry.get(“/member”,{term:this.term});
},
},
};

尝试使用
{preserveState:true}
选项

您的代码需要如下内容:

this.$inertia.get("/member", { term: this.term }, { preserveState: true });
请参阅文档