1

i am using nuxt.js in my form i have vuetify "Select" Dropdown list but it not showing drop down item how to fix this error.

<v-col class="d-flex" cols="12" sm="6" >
    <v-select :items="items" v-model.trim="form.city" label="Outlined style" outlined ></v-select>
</v-col>
<v-col cols="12" sm="12">

{{errors.GSTIN[0]}} <v-file-input v-model="form.shop_front_image" type="file" label="shop_front_image" outlined autocomplete="off" @change="handleFile()" id="file"> {{errors.shop_front_image[0]}}

<script scoped>
  export default {
     
    data() {
      return {
        form: {
          city:'',
          GSTIN: '',
          shop_front_image:'',
        }
      }
    },
    methods: {
      handleFile() {
        let input = document.getElementById("file")
        console.log(input)
        this.form.shop_front_image = input.files[0]
       
      },
      async submit() {
    
        let formData = new FormData(); 
        
        formData.append('city', this.form.city)
        formData.append('GSTIN', this.form.GSTIN)
        formData.append('shop_front_image', this.form.shop_front_image)
     
        console.log(formData)
     
        let rsp = await this.$axios.$post('/Businessregister', formData, {
          headers: {
            'Content-Type':'multipart/form-data'
          }
        })
        console.log(rsp.response)
      }
   
      }
    }

</script>

<script>
  export default {
    data: () => ({
      items: ['Mumbai', 'Delhi', 'Bangalore'],
    }),
  }
</script>
2
  • You defined two script tags, we dont have scoped for script tag, scoped is for style tag Commented Oct 11, 2020 at 8:05
  • @Mohsen can you post your answer for batter understand thank you Commented Oct 11, 2020 at 8:06

1 Answer 1

1

Transfer items from second script tag to first, and remove second script tag

<script>
  export default {
     
    data() {
      return {
        items: ['Mumbai', 'Delhi', 'Bangalore'],
        form: {
          city:'',
          GSTIN: '',
          shop_front_image:'',
        }
      }
    },
    methods: {
      handleFile() {
        let input = document.getElementById("file")
        console.log(input)
        this.form.shop_front_image = input.files[0]
       
      },
      async submit() {
    
        let formData = new FormData(); 
        
        formData.append('city', this.form.city)
        formData.append('GSTIN', this.form.GSTIN)
        formData.append('shop_front_image', this.form.shop_front_image)
     
        console.log(formData)
     
        let rsp = await this.$axios.$post('/Businessregister', formData, {
          headers: {
            'Content-Type':'multipart/form-data'
          }
        })
        console.log(rsp.response)
      }
   
      }
    }

</script>
<style scoped>

<style>

scoped attribute is for style tag.

Sign up to request clarification or add additional context in comments.

3 Comments

scoped attribute is for style tag. Got it
i have 2 more Dropdown if i changed :items="items" to :drop1="drop1" and :drop2="drop2" its not showing dropdown item how to fix this
:items = "drop1" , items is prop name and drop1 is value assigned to it, same for second v-select :items = "drop2"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.