Skip to content

Commit

Permalink
refactor: 升级依赖 & 依赖所带来的影响
Browse files Browse the repository at this point in the history
  • Loading branch information
dream2023 committed Sep 5, 2020
1 parent df4615b commit 6074ced
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"sass-loader": "^8.0.2",
"standard-version": "^9.0.0",
"vue": "^2.6.11",
"vue-ele-form": "^0.8.42",
"vue-ele-form": "^0.8.43",
"vue-template-compiler": "^2.6.11"
},
"repository": {
Expand Down
9 changes: 3 additions & 6 deletions src/components/main/components/preview-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@closed="isShowContent = false"
>
<ele-form
v-bind="formConfig"
v-bind="frender.formBindConfig"
v-model="formData"
:visible="visible"
v-if="isShowContent"
Expand All @@ -21,8 +21,6 @@
</template>

<script>
const cloneDeep = require("clone");
export default {
inject: ["frender"],
props: {
Expand All @@ -43,15 +41,14 @@ export default {
watch: {
visible(val) {
if (val) {
// 因为 ele-form 会自动添加一些隐藏属性,所以,这里复制一份,避免修改原数据
this.formConfig = cloneDeep(this.frender.formBindConfig);
// 重置数据
this.formData = {};
}
}
},
methods: {
handleRequest(data) {
// eslint-disable-next-line no-console
// eslint-disable-next-line
console.log(data);
return Promise.resolve(data);
},
Expand Down
1 change: 0 additions & 1 deletion src/components/right/form-item-common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
title="表单项配置"
v-model="keyword"
/>
<!-- 这里不能用 v-model 会产生循环引用 -->
<ele-form
:formData="formItemList[currentIndex]"
:formDesc="filteredFormDesc"
Expand Down
6 changes: 1 addition & 5 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ export function reomveQuotes(str) {
export function removeUselessAttrs(obj = {}, defaultObj = {}) {
const isEmpty = val => _.isNil(val);
const isDefault = (val, key) => equal(val, defaultObj[key]);
const isHide = key => (key || "").startsWith("_");

return _.omitBy(
obj,
(val, key) => isEmpty(val) || isHide(key) || isDefault(val, key)
);
return _.omitBy(obj, (val, key) => isEmpty(val) || isDefault(val, key));
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9834,10 +9834,10 @@ vue-ele-form-dynamic@^0.4.2:
async-validator "^3.2.0"
fast-deep-equal "^3.1.1"

vue-ele-form@^0.8.42:
version "0.8.42"
resolved "https://registry.npm.taobao.org/vue-ele-form/download/vue-ele-form-0.8.42.tgz#f0cb74606a7385e2071edab055c62a0e801df2e6"
integrity sha1-8Mt0YGpzheIHHtqwVcYqDoAd8uY=
vue-ele-form@^0.8.43:
version "0.8.43"
resolved "https://registry.npm.taobao.org/vue-ele-form/download/vue-ele-form-0.8.43.tgz#c7d4c9f715862c344f063e7c56db934879808629"
integrity sha1-x9TJ9xWGLDRPBj58VtuTSHmAhik=
dependencies:
clone "^2.1.2"
dayjs "^1.8.31"
Expand Down

0 comments on commit 6074ced

Please sign in to comment.