vue 开发中实现provide和inject的响应式数据监听

// 父组件里

provide() {

        return {

            isManual: {

                status : 'none',

            }

        }

},

// 改变provide里的对象值

this._provided.isManual.status = '0';

子组件里正常使用

1

2

3

4

inject: ['isManual'],

//子组件里打印 isManual

console.log('isisManual-->'this.isManual);

上一篇:Servlet依赖


下一篇:Could not find a package configuration file provided by “gazebo_ros“ with any of the following nam