Skip to content
experimental

Input: script and composition api

import { defineComponent, toRefs, computed, ref } from "vue";
type Props = {
  msg?: string;
  foo?: string;
};
const props = withDefaults(defineProps<Props>(), { msg: "HelloWorld" });
const emit = defineEmits<{ (e: "change", value: number): void }>();

const { msg, foo } = toRefs(props);
const newMsg = computed(() => msg.value + "- HelloWorld");

const count = ref(0);
emit("change", 124);