摘要:
代码如下: <script> // 需求:将扁平数据转为树形结构 const list = [ { id: 1, name: "广东", pid: 0 }, { id: 11, name: "深圳", pid: 1 }, { id: 12, name: "东莞", pid: 1 }, { id: 2 阅读全文
摘要:
父组件代码如下: <template> <div> 我是父组件: <input type="text" v-model="msg"> <!-- :value.sync='msg'等价于:value = 'msg' @update:value='msg=$event' --> <son-box :va 阅读全文
摘要:
父组件代码如下: <template> <div> 我是父组件: <input type="text" v-model="msg"> <son-box v-model="msg"/> </div> </template> <script> // 导入子组件 import SonBox from '@ 阅读全文