2020-07-10 19:19 2023-12-03 19:01 标签:vue,props,watch
v-if和v-show不能用的太随意,必须要分清什么场合使用
- 1
- 2
- 3
- 4
- 5
- 6
- props: ['id'],
- watch: {
- id: function (val) {
- this.getWebClass()
- }
- }
父路由里,根据路由名称来判断是否显示模块
- 1
- <v-web-class :id="classId" v-if="routeName=='web' || routeName=='view'"></v-web-class>