Skip to content

Commit 6f708cb

Browse files
Kerrykerry-emqx
authored andcommitted
fix(KeyAndValueEditor):add defineComponent to resolve type error
1 parent de11ce6 commit 6f708cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/KeyAndValueEditor.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</template>
3131

3232
<script lang="ts">
33-
import { ref, computed, Ref } from "vue";
33+
import { ref, computed, Ref, defineComponent } from "vue";
3434
import { useI18n } from "vue-i18n";
3535
3636
enum State {
@@ -43,7 +43,7 @@ type kvRow = {
4343
state: State;
4444
};
4545
46-
export default {
46+
export default defineComponent({
4747
name: "KeyAndValueEditor",
4848
emits: ["update:modelValue"],
4949
props: {
@@ -68,7 +68,7 @@ export default {
6868
6969
function createTbData() {
7070
const d = props.modelValue;
71-
Object.entries(d).forEach(([key, value]) => {
71+
Object.entries(d).forEach(([key, value]: [string, string]) => {
7272
tableData.value.push({ key, value, state: 0 });
7373
});
7474
}
@@ -108,7 +108,7 @@ export default {
108108
keyValueLabel,
109109
};
110110
},
111-
};
111+
});
112112
</script>
113113

114114
<style lang="scss" scoped>

0 commit comments

Comments
 (0)