这是一个创建于 1021 天前的主题,其中的信息可能已经有所发展或是发生改变。
3 条回复 • 2022-04-27 16:32:47 +08:00
![MEIyiyi](https://cdn.v2ex.com/avatar/e72f/5f99/574470_normal.png?m=1655815945) |
|
1
MEIyiyi 2022-04-27 15:27:59 +08:00
props 不都是父组件传进来的吗,根据单向数据流,是没法删的吧。要删的话就用事件 on/emit 删?
|
![nitmali](https://cdn.v2ex.com/gravatar/cc3bee01cfb143f73f19e18a466baa3c?s=48&d=retro) |
|
2
nitmali 2022-04-27 15:54:35 +08:00
可以,直接 `` delete component.$props.key ``
|
![coolair](https://cdn.v2ex.com/avatar/c4fe/52ac/36118_normal.png?m=1691894552) |
|
3
coolair 2022-04-27 16:32:47 +08:00
@ nitmali 在子组件中可以吗?刚试了下,只是删了数据,页面没有响应更新。
|