Skip to content

Using v-model with @vue/compat and configureCompat in Composition API #7862

Discussion options

You must be logged in to vote

But I'm using the Composition API with TypeScript and there is no configureCompat member to import in my setup. So here is my question:
How can I configure my component compatibility?

By using a second script block.

<script>
export default {
  compatConfig: {
    MODE: 2,
    COMPONENT_V_MODEL: false,
  }
}
</script>
<script setup>
const props = defineProps<{ modelValue: string }>();

const content = computed({
  get: () => props.modelValue,
  set: (value) => emit("update:modelValue", value),
});
</script>

``

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by d9beuD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants