|
|
@@ -0,0 +1,85 @@
|
|
|
+<template>
|
|
|
+ <div class="width">
|
|
|
+ <input class="textarea" type="text" v-model="inputText"/>
|
|
|
+ <span> per </span>
|
|
|
+ <div class="selection">
|
|
|
+ <input type="radio" id="day" value="day" v-model="picked"><label for="day">day</label><span> / </span>
|
|
|
+ <input type="radio" id="week" value="week" v-model="picked"><label for="week">week</label><span> / </span>
|
|
|
+ <input type="radio" id="month" value="month" v-model="picked"><label for="month">month</label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ inputText: '',
|
|
|
+ picked: 'day',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getContent() {
|
|
|
+ return this.inputText === '' ? '' : this.inputText + ' per ' + this.picked
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ isOkay() {
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ inputText: function() {
|
|
|
+ this.$emit('update')
|
|
|
+ },
|
|
|
+ isOkay: function() {
|
|
|
+ this.$emit('okchange')
|
|
|
+ },
|
|
|
+ picked: function() {
|
|
|
+ this.$emit('okchange')
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .selection {
|
|
|
+ display: inline;
|
|
|
+ }
|
|
|
+
|
|
|
+ .selection input {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .selection label {
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ color: #777;
|
|
|
+ background-color: #333;
|
|
|
+ padding: 0.1em 0.2em;
|
|
|
+ }
|
|
|
+
|
|
|
+ .selection label:hover {
|
|
|
+ color: #fff;
|
|
|
+ background-color: #777;
|
|
|
+ }
|
|
|
+
|
|
|
+ .selection input:checked + label {
|
|
|
+ color: #ddd;
|
|
|
+ background-color: #666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .textarea {
|
|
|
+ width: 5em;
|
|
|
+ margin: auto;
|
|
|
+
|
|
|
+ color: #fff;
|
|
|
+ border: 1px solid #aaa;
|
|
|
+ background-color: #222;
|
|
|
+ }
|
|
|
+
|
|
|
+ .width {
|
|
|
+ width: 100%;
|
|
|
+ max-width: 60em;
|
|
|
+ }
|
|
|
+</style>
|