mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-14 02:03:20 +00:00
28 lines
545 B
Vue
28 lines
545 B
Vue
<template>
|
|
<li class="md-option" @click="selectOption" v-md-ink-ripple>
|
|
<slot></slot>
|
|
</li>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
value: {
|
|
type: [String, Boolean],
|
|
required: true
|
|
}
|
|
},
|
|
methods: {
|
|
selectOption() {
|
|
this.$parent.selectOption(this.value);
|
|
}
|
|
},
|
|
ready() {
|
|
if (!this.$parent.$el.classList.contains('md-select')) {
|
|
this.$destroy();
|
|
|
|
throw new Error('You should wrap the md-option in a md-select');
|
|
}
|
|
}
|
|
};
|
|
</script>
|