💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## 概述 当一个子组件改变了一个 prop 的值时,这个变化也会同步到父组件中所绑定 实例 ``` <!-- 父组件 --> <template> <view> <syncA :title.sync="title"></syncA> </view> </template> <script> export default { data() { return { title:"hello vue.js" } } } </script> ``` ``` <!-- 子组件 --> <template> <view> <view @click="changeTitle">{{title}}</view> </view> </template> <script> export default { props: { title: { default: "hello" }, }, methods:{ changeTitle(){ //触发一个更新事件 this.$emit('update:title',"uni-app") } } } </script> ```