Browse Source

Переход на quasar

Book Pauk 5 years ago
parent
commit
e423b5d745
1 changed files with 20 additions and 3 deletions
  1. 20 3
      client/components/share/NumInput.vue

+ 20 - 3
client/components/share/NumInput.vue

@@ -5,11 +5,21 @@
         class="no-mp"
         class="no-mp"
         :class="(error ? 'error' : '')"
         :class="(error ? 'error' : '')"
     >
     >
+        <slot></slot>
         <template v-slot:prepend>
         <template v-slot:prepend>
-            <q-icon name="la la-minus-circle" class="button" v-ripple @click="minus"/>
+            <q-icon :class="(validate(value - step) ? '' : 'disable')" 
+                name="la la-minus-circle" 
+                class="button" 
+                :v-ripple="validate(value - step)" 
+                @click="minus"
+            />
         </template>
         </template>
         <template v-slot:append>
         <template v-slot:append>
-            <q-icon name="la la-plus-circle" class="button" v-ripple @click="plus"/>
+            <q-icon :class="(validate(value + step) ? '' : 'disable')"
+                name="la la-plus-circle"
+                class="button"
+                :v-ripple="validate(value + step)"
+                @click="plus"/>
         </template>
         </template>
     </q-input>
     </q-input>
 </template>
 </template>
@@ -87,10 +97,11 @@ class NumInput extends NumInputProps {
 .button {
 .button {
     font-size: 130%;
     font-size: 130%;
     border-radius: 20px;
     border-radius: 20px;
-    color: #616161;
+    color: #bbb;
 }
 }
 
 
 .button:hover {
 .button:hover {
+    color: #616161;
     background-color: #efebe9;
     background-color: #efebe9;
 }
 }
 
 
@@ -98,4 +109,10 @@ class NumInput extends NumInputProps {
     background-color: #ffabab;
     background-color: #ffabab;
     border-radius: 3px;
     border-radius: 3px;
 }
 }
+
+.disable, .disable:hover {
+    cursor: not-allowed;
+    color: #bbb;
+    background-color: white;
+}
 </style>
 </style>