Showing
1 changed file
with
14 additions
and
14 deletions
| ... | @@ -128,22 +128,22 @@ const rules = [{ validator, message: validatorMessage }]; | ... | @@ -128,22 +128,22 @@ const rules = [{ validator, message: validatorMessage }]; |
| 128 | 128 | ||
| 129 | // 适配cookie保存未完成表单 | 129 | // 适配cookie保存未完成表单 |
| 130 | watch( | 130 | watch( |
| 131 | - () => props.item.value, | 131 | + () => props.item.value, |
| 132 | - (v) => { | 132 | + (v) => { |
| 133 | - const currentValue = v; | 133 | + const currentValue = v; |
| 134 | - const existingCookie = Cookies.get($route.query.code); | 134 | + const existingCookie = Cookies.get($route.query.code); |
| 135 | 135 | ||
| 136 | - if (existingCookie) { | 136 | + if (existingCookie) { |
| 137 | - // 如果Cookie存在,更新它 | 137 | + // 如果Cookie存在,更新它 |
| 138 | - let obj = JSON.parse(existingCookie); | 138 | + let obj = JSON.parse(existingCookie); |
| 139 | - obj[props.item.key] = currentValue; // 替换掉旧值 | 139 | + obj[props.item.key] = currentValue; // 替换掉旧值 |
| 140 | - Cookies.set($route.query.code, JSON.stringify(obj)); | 140 | + Cookies.set($route.query.code, JSON.stringify(obj)); |
| 141 | - } else { | 141 | + } else { |
| 142 | - // 如果Cookie不存在,新增它 | 142 | + // 如果Cookie不存在,新增它 |
| 143 | - Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue })); | 143 | + Cookies.set($route.query.code, JSON.stringify({ [props.item.key]: currentValue })); |
| 144 | - } | ||
| 145 | } | 144 | } |
| 146 | - ); | 145 | + } |
| 146 | +); | ||
| 147 | </script> | 147 | </script> |
| 148 | 148 | ||
| 149 | <style lang="less" scoped> | 149 | <style lang="less" scoped> | ... | ... |
-
Please register or login to post a comment