Commit ac481fb7 by 胡悦

添加注释

1 parent 8759ae2f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-05 15:11:53 * @Date: 2023-07-05 15:11:53
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-05 17:19:32 * @LastEditTime: 2023-07-06 12:01:43
--> -->
<template> <template>
<div v-show="isShow" class="select-box" :style="{'width': boxWidth}"> <div v-show="isShow" class="select-box" :style="{'width': boxWidth}">
...@@ -22,6 +22,7 @@ export default { ...@@ -22,6 +22,7 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
// dataList里面的值是否是对象
isObject: { isObject: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -34,6 +35,7 @@ export default { ...@@ -34,6 +35,7 @@ export default {
type: String, type: String,
default: 'value' default: 'value'
}, },
// 下拉框的宽度设置
boxWidth: { boxWidth: {
type: String type: String
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-06 11:56:03 * @LastEditTime: 2023-07-06 12:00:03
* @FilePath: \dj-data-view\src\components\ViewTitle.vue * @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -37,9 +37,9 @@ export default { ...@@ -37,9 +37,9 @@ export default {
return { return {
isShow: false, isShow: false,
dataList: datas.DefaultData.businessList, dataList: datas.DefaultData.businessList,
firstTab: '', firstTab: '', // 存储第一个tab下的子菜单对象
now: new Date().format('yyyy-MM-dd hh:mm:ss'), now: new Date().format('yyyy-MM-dd hh:mm:ss'),
currentMenu: 'home' currentMenu: 'home' // 标记当前是哪个tab菜单
} }
}, },
mounted() { mounted() {
...@@ -55,14 +55,14 @@ export default { ...@@ -55,14 +55,14 @@ export default {
openSelect() { openSelect() {
this.isShow = !this.isShow this.isShow = !this.isShow
}, },
// 监听子菜单变化
selectVal(val) { selectVal(val) {
console.log(val)
this.firstTab = val this.firstTab = val
this.$bus.$emit('selectVal', val.value) this.$bus.$emit('selectVal', val.value)
this.openSelect() this.openSelect()
}, },
// tab菜单切换
jump(val) { jump(val) {
console.log(val)
let _val = val let _val = val
this.currentMenu = val this.currentMenu = val
if (val === 'home') _val = this.firstTab.value if (val === 'home') _val = this.firstTab.value
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!