修改跳转

dev
夜笙歌 1 year ago
parent da13e574c2
commit 7b691403db

@ -12,8 +12,11 @@
<span class="el-dropdown-link"> <span class="el-dropdown-link">
{{ name }} <i class="el-icon-arrow-down el-icon--right"></i> {{ name }} <i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<el-dropdown-menu slot="dropdown" > <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{router:i.router,name:i.sceneName}" v-for="i in selectSecnesList">{{ i.sceneName }}</el-dropdown-item> <el-dropdown-item v-for="i in selectSecnesList" :command="{router:i.router,name:i.sceneName}">{{
i.sceneName
}}
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
@ -29,13 +32,13 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right" >
<span> <span>
</span> </span>
</div> </div>
<div class="rightImg"> <div class="rightImg" @click="toIndex">
</div> </div>
</div> </div>
</template> </template>
@ -49,7 +52,7 @@ export default {
data() { data() {
return { return {
selectSecnesList: [], selectSecnesList: [],
name:'智慧场景' name: '智慧场景'
} }
}, },
props: { props: {
@ -61,8 +64,8 @@ export default {
mounted() { mounted() {
this.setSelectSecnes() this.setSelectSecnes()
if(this.$route.name === 'SmartScene'){ if (this.$route.name === 'SmartScene') {
if(this.$route.query?.name){ if (this.$route.query?.name) {
this.name = this.$route.query?.name this.name = this.$route.query?.name
} }
} }
@ -72,12 +75,16 @@ export default {
const {data} = await selectSecnes() const {data} = await selectSecnes()
this.selectSecnesList = data this.selectSecnesList = data
}, },
toLink(e){ toLink(e) {
this.$router.push({ path: "/board/"+e }); this.$router.push({path: "/board/" + e});
}, },
dropdownLink(e){ dropdownLink(e) {
this.name = e.name this.name = e.name
this.$router.push({ path: "/board/"+(e.router||'smartScene'),query: {name: e.name} }); this.$router.push({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}});
},
toIndex() {
console.log(123)
this.$router.push({path: "/index"});
} }
} }
}; };

Loading…
Cancel
Save