xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Vue 3 不支持 props 解构赋值 All In One

Vue 3 不支持 props 解构赋值 All In One

解构赋值 好处/优点


const obj = {id: 1};

let { id } = obj;

id;
// 1

id = 2;
// 2
obj;
// {id: 1}

obj.id = 3;
// 3
obj;
// {id: 3}





https://v3.vuejs.org/guide/component-props.html#prop-types

https://v3.cn.vuejs.org/guide/component-props.html

bad ways

https://www.cnblogs.com/xgqfrms/p/14483677.html

https://v3.cn.vuejs.org/guide/component-props.html#单向数据流

refs

解构赋值

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-03-05 20:25  xgqfrms  阅读(2043)  评论(4编辑  收藏  举报