Skip to content

Commit

Permalink
fix(KeyAndValueEditor):add defineComponent to resolve type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry authored and kerry-emqx committed Dec 7, 2021
1 parent de11ce6 commit 6f708cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/KeyAndValueEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</template>

<script lang="ts">
import { ref, computed, Ref } from "vue";
import { ref, computed, Ref, defineComponent } from "vue";
import { useI18n } from "vue-i18n";
enum State {
Expand All @@ -43,7 +43,7 @@ type kvRow = {
state: State;
};
export default {
export default defineComponent({
name: "KeyAndValueEditor",
emits: ["update:modelValue"],
props: {
Expand All @@ -68,7 +68,7 @@ export default {
function createTbData() {
const d = props.modelValue;
Object.entries(d).forEach(([key, value]) => {
Object.entries(d).forEach(([key, value]: [string, string]) => {
tableData.value.push({ key, value, state: 0 });
});
}
Expand Down Expand Up @@ -108,7 +108,7 @@ export default {
keyValueLabel,
};
},
};
});
</script>

<style lang="scss" scoped>
Expand Down

0 comments on commit 6f708cb

Please sign in to comment.