From b5c5eb130ca0848124f9d136af4be142ad5aac07 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 14:42:02 +0800
Subject: [PATCH] backup0626
---
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js | 35 ++++++++++++++---------------------
1 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
index 2fab414..fa196e7 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
@@ -1,41 +1,34 @@
-import { LightningElement, api, track } from 'lwc';
+import { LightningElement,api,track } from 'lwc';
export default class CustomShippingUnitPriceComp extends LightningElement {
@api recordId;
@api shippingUnitPrice;
- connectedCallback() {
+ connectedCallback(){
console.log('shippingUnitPrice = ' + this.shippingUnitPrice);
}
limitDecimals(event) {
const value = parseFloat(event.target.value); // 灏嗚緭鍏ュ�艰浆鎹负鏁板瓧绫诲瀷
const roundedValue = Math.round(value * 100) / 100; // 灏嗘暟瀛楀洓鑸嶄簲鍏ュ埌涓や綅灏忔暟
- if (isNaN(value) || isNaN(roundedValue)) {
- // 濡傛灉鏁板瓧鏃犳晥锛屽垯娓呯┖杈撳叆妗�
+ if (isNaN(value) || isNaN(roundedValue)) { // 濡傛灉鏁板瓧鏃犳晥锛屽垯娓呯┖杈撳叆妗�
event.target.value = '';
- } else if (roundedValue !== value) {
- // 濡傛灉杈撳叆妗嗙殑鍊艰秴鍑轰簡涓や綅灏忔暟锛屽垯淇敼涓轰袱浣嶅皬鏁�
+ } else if (roundedValue !== value) { // 濡傛灉杈撳叆妗嗙殑鍊艰秴鍑轰簡涓や綅灏忔暟锛屽垯淇敼涓轰袱浣嶅皬鏁�
event.target.value = roundedValue.toFixed(2);
}
}
- shipmentUnitPriceBlur(event) {
- console.log('shipmentUnitPriceBlur');
+ shipmentUnitPriceBlur(event){
+ console.log('shipmentUnitPriceBlur')
this.shippingUnitPrice = event.target.value;
- this.dispatchEvent(
- new CustomEvent('shipmentunitprice', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: {
- shipmentunitprice: this.shippingUnitPrice,
- recordId: this.recordId
- }
- }
- })
- );
+ this.dispatchEvent(new CustomEvent('shipmentunitprice', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { shipmentunitprice: this.shippingUnitPrice, recordId: this.recordId }
+ }
+ }));
}
}
\ No newline at end of file
--
Gitblit v1.9.1