clearing select field automatically after selecting item

前端 未结 4 1459
执念已碎
执念已碎 2021-01-18 08:29

I can\'t find a way to clear the select field in method \"afterselection\" which is invoked after selecting an item:

template:



        
4条回答
  •  佛祖请我去吃肉
    2021-01-18 09:30

    I faced with the same issues. I have several v-select components in card text block and clear btn. When i click on clear i run clear func and clear all v-select items by refs.

    template:

     
      Filters
      
        
      
      
        Clear
      
    
    

    script:

    methods: { 
      ...
      clear: function() {
        Object.values(this.$refs).forEach(ref => {
          const vueSelect = ref[0];
          vueSelect.internalValue = [];
        });
      },
    }
    

提交回复
热议问题