Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

头部,侧边栏,内容相互独立,点击头部里面的按钮如何删除侧边栏和内容里面的div


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
388 views
Welcome To Ask or Share your Answers For Others

1 Answer

如果不用vuex的话, 可以将头部, 侧边栏, 内容的vue实例都放在一个全局object中, 当你点击头部按钮的时候, 调用全局obj.侧边栏.删除div()方法.

如果用vuex的话, 可以增加使用一个delFlag, 头部点击按钮, 设置vuex中delFlag为true, 侧边栏和内容的vue实例中都computed该delFlag, 即可检测到头部点击了该按钮.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...