vue3父子组件传参

这里写自定义目录标题

  • 父子组件常用定义

父子组件常用定义

去博客设置页面,选择一款你喜欢的代码片高亮样式,下面展示同样高亮的 代码片.

interface Props {
	modelValue: RouteRecordName | undefined;
	list: RouteRecordRaw[];
	isPressUpOrDown: boolean;
}

const props = defineProps<Props>();
const emit = defineEmits<{
	'update:modelValue': [RouteRecordName | undefined];
}>();
defineExpose({toFatherMethod, toFatherValue});//暴露方法和属性给父组件

你可能感兴趣的:(javascript,开发语言,vue.js)