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

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

vue的多级联动问题

image.png
如图所示,比如我选择了河北,点了石家庄,:class="item === nowPrice ? 'lan' : ''" 这样就加上了颜色,然后点击确定没问题再打开显示石家庄没问题,如果不点确定 点body关闭之后再打开应该还是全球,这应该怎么实现,求指导


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

1 Answer

0 votes
by (71.8m points)

解决了,有重新定义了一个变量,选择了点击确定就赋值给变量,不点确定不赋值,点击打开的时候让选择值等于变量默认就是选中的了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...