UPDATE

上级 5c3fbee2
<script setup> <script setup>
import baVal = ref(0);
import erzi from './erzi.vue'; import erzi from './erzi.vue';
const fuValJia = () => { let baVal = "我是来自父组件的值";
baVal++;
}
</script> </script>
<template> <template>
<button @click="fuValJia">父组件的值加一</button>
<erzi :title="baVal"></erzi> <erzi :title="baVal"></erzi>
</template> </template>
<style scoped> <style scoped>
</style> </style>
\ No newline at end of file
<script setup> <script setup>
const props = defineProps({ const props = defineProps({
title: { title: String,
type:String,
default: "默认值"
}
}); });
console.log(props.title);
</script> </script>
<template> <template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册