|
@@ -125,6 +125,19 @@ export default {
|
|
|
},
|
|
|
immediate: true,
|
|
|
},
|
|
|
+ innerValue: {
|
|
|
+ handler: function (newValue) {
|
|
|
+ if (!newValue) {
|
|
|
+ const {
|
|
|
+ $props: { source, dataMapping },
|
|
|
+ } = this;
|
|
|
+ for (let key in dataMapping) {
|
|
|
+ source[key] = undefined;
|
|
|
+ }
|
|
|
+ this.$emit("update:source", source);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
//
|
|
@@ -256,11 +269,11 @@ export default {
|
|
|
handleClear() {
|
|
|
const { source, multiple, dataMapping } = this.$props;
|
|
|
if (!multiple) {
|
|
|
- // this.innerValue = "";
|
|
|
- for (let key in dataMapping) {
|
|
|
- source[key] = "";
|
|
|
- }
|
|
|
- this.$emit("update:source", source);
|
|
|
+ this.innerValue = "";
|
|
|
+ // for (let key in dataMapping) {
|
|
|
+ // source[key] = "";
|
|
|
+ // }
|
|
|
+ // this.$emit("update:source", source);
|
|
|
}
|
|
|
},
|
|
|
async useAutocomplete(prop, cb) {
|