Reorganize components, create ObjectFrame

This commit is contained in:
Pete Richards
2018-12-13 09:16:42 -08:00
parent 18a94d938f
commit afa1589cb5
41 changed files with 179 additions and 112 deletions

View File

@@ -0,0 +1,34 @@
<template>
<div class="c-ctrl-wrapper">
<div class="c-click-icon"
:title="nextValue.title"
:class="nextValue.icon"
@click="cycle">
</div>
</div>
</template>
<script>
export default {
props: {
options: {
type: Object
}
},
computed: {
nextValue() {
let currentValue = this.options.options.filter((v) => this.options.value === v.value)[0];
let nextIndex = this.options.options.indexOf(currentValue) + 1;
if (nextIndex >= this.options.options.length) {
nextIndex = 0;
}
return this.options.options[nextIndex];
}
},
methods: {
cycle() {
this.$emit('change', this.nextValue.value, this.options);
}
}
};
</script>