修复商品库存价格编辑小程序兼容无反应问题

This commit is contained in:
2024-11-04 10:23:06 +08:00
parent 20c4631ad4
commit e064484fe2
2 changed files with 17 additions and 3 deletions

View File

@@ -89,7 +89,8 @@
reactive, reactive,
ref, ref,
watch, watch,
nextTick nextTick,
onMounted
} from 'vue'; } from 'vue';
import { import {
returnSkuSnap, returnSkuSnap,
@@ -138,7 +139,10 @@
} }
} }
}) })
let data = ref(props.goods) let data = ref({
lowPrice: 0,
skuList: []
})
const rules = { const rules = {
'lowPrice': [{ 'lowPrice': [{
type: 'Number', type: 'Number',
@@ -221,6 +225,10 @@
// skuSnap: JSON.stringify(skuSnap) // skuSnap: JSON.stringify(skuSnap)
// }) // })
// } // }
onMounted(()=>{
refForm.value.setRules(rules)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -170,7 +170,9 @@
active: 0 active: 0
}) })
const data = ref(props.goods) const data = ref({
name:''
})
const emits = defineEmits(['update:show', 'save']) const emits = defineEmits(['update:show', 'save'])
const form = reactive({ const form = reactive({
note: '' note: ''
@@ -252,6 +254,10 @@
// skuSnap: JSON.stringify(skuSnap) // skuSnap: JSON.stringify(skuSnap)
// }) // })
// } // }
onMounted(()=>{
refForm.value.setRules(rules)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>