Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MdSelect] not work #1687

Closed
zhuyinjing opened this issue Apr 17, 2018 · 6 comments
Closed

[MdSelect] not work #1687

zhuyinjing opened this issue Apr 17, 2018 · 6 comments

Comments

@zhuyinjing
Copy link

zhuyinjing commented Apr 17, 2018

i use vue-material ^1.0.0-beta-7
and i write my code :

<md-field class="width-50">
                <label for="input_shape">input_shape</label>

                <md-select v-model="input_shape" name="input_shape" id="input_shape">
                  <md-option :value="item" v-for="(item, index) in inputshapeArgs" :key="index">{{item}}</md-option>
                </md-select>
              </md-field>

if i select md-option the md-select doesn't work , it shows nothing ... actually i already selected...
2018-04-17 11-07-24
what's wrong with my code??
thanks so much!!!

@VdustR
Copy link
Member

VdustR commented Apr 17, 2018

Are your options objects?

@VdustR VdustR changed the title md-select not work [MdSelect] not work Apr 17, 2018
@zhuyinjing
Copy link
Author

zhuyinjing commented Apr 17, 2018

2018-04-17 11-31-46
I want to select the first option by default, but there is no display of the value on select, but the first one is actually selected.
BTW, options are (5) ["(48,48,3)", "(100,100,3)", "(150,150,3)", "(224,224,3)", "(299,299,3)", __ob__: Observer]

@VdustR
Copy link
Member

VdustR commented Apr 17, 2018

Would you upgrade vue-material to latest beta and provide your code in Codepen or CodeSandbox?

@zhuyinjing
Copy link
Author

zhuyinjing commented Apr 17, 2018

ok...
https://codesandbox.io/s/0ow377y17n
i set a default value already,and it doesn't show on md-select

@VdustR
Copy link
Member

VdustR commented Apr 17, 2018

Thanks.

I believe it has been fixed with commit 01dfdfb.

It's weird that this commit is before 1.0.0-beta-8 released.

I tested this case and it runs great with dev branch. It should be duplicated with #1262.

Before next release, you could fix it with following codes temporary:

<template>
  <md-field v-if="show">
</template>

<script>
export default {
  data () {
    return {
      show: false
    },
  },
  mounted () {
    this.show = true
  }
}
</script>

@Samuell1
Copy link
Member

Loading data for selects should be in created hook

@VdustR VdustR closed this as completed Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants