Explorar o código

fix: uni-app v-model警告 — apply.vue picker改用@change, profile/index.vue computed从vue导入

apply.vue: <picker v-model> → @change,uni-app不支持非表单元素的v-model
profile/index.vue: computed应从vue导入,@dcloudio/uni-app不导出computed

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg hai 3 meses
pai
achega
809b764b30
Modificáronse 2 ficheiros con 7 adicións e 2 borrados
  1. 5 1
      client/pages/plan/apply.vue
  2. 2 1
      client/pages/profile/index.vue

+ 5 - 1
client/pages/plan/apply.vue

@@ -35,7 +35,7 @@
           class="picker" 
           mode="selector" 
           :range="priceRanges"
-          v-model="form.priceIndex"
+          @change="onPriceChange"
         >
           <view class="picker-value">
             {{ priceRanges[form.priceIndex] }}
@@ -89,6 +89,10 @@ const onDemandTypeChange = (e) => {
   form.value.demandType = e.detail.value
 }
 
+const onPriceChange = (e) => {
+  form.value.priceIndex = parseInt(e.detail.value, 10)
+}
+
 const onSubmit = async () => {
   // Validate form
   if (!form.value.demandType) {

+ 2 - 1
client/pages/profile/index.vue

@@ -204,7 +204,8 @@
 </template>
 
 <script setup>
-import { computed, onShow } from '@dcloudio/uni-app'
+import { computed } from 'vue'
+import { onShow } from '@dcloudio/uni-app'
 import { useUserStore } from '@/stores/user'
 
 const userStore = useUserStore()