|
@@ -1,36 +1,33 @@
|
|
|
<template>
|
|
|
- <el-tooltip :content="btn_Info['textInfo']" placement="top" :disabled="!isBubble || !btn_Info['textInfo']" v-if="btn_Info">
|
|
|
- <slot></slot>
|
|
|
+ <el-tooltip v-if="btn_Info" :content="btn_Info.textInfo" placement="top" :disabled="!isBubble || !btn_Info.textInfo">
|
|
|
+ <slot />
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref,watch,onMounted} from "vue";
|
|
|
-import {useAppStore} from "~src/store";
|
|
|
-const useAppState = useAppStore()
|
|
|
-
|
|
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
|
keys: {
|
|
|
type: String,
|
|
|
- default: ''
|
|
|
- }
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
+const useAppState = useAppStore()
|
|
|
+
|
|
|
//变量
|
|
|
-const btn_Info = ref(false);
|
|
|
-const btn_key = ref(props.keys);
|
|
|
-const isBubble = ref(useAppState.getBubble);
|
|
|
+const btn_Info = ref(false)
|
|
|
+const btn_key = ref(props.keys)
|
|
|
+const isBubble = ref(useAppState.getBubble)
|
|
|
|
|
|
//监听
|
|
|
-watch(() => [
|
|
|
- props.keys,
|
|
|
- useAppState.getBubble,
|
|
|
-], ([keys, bubble]) => {
|
|
|
+watch(() => [props.keys, useAppState.getBubble, useAppState.getButtons], ([keys, bubble, btns]) => {
|
|
|
btn_key.value = keys
|
|
|
isBubble.value = bubble
|
|
|
btn_Info.value = getButtonsVal(keys)
|
|
|
-})
|
|
|
+}, { deep: true })
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(()=> {
|
|
@@ -41,6 +38,7 @@ onMounted(()=> {
|
|
|
|
|
|
//获取气泡数据
|
|
|
const getButtonsVal = (value) => {
|
|
|
+ console.log(useAppState.getBubble)
|
|
|
return useAppState.getButtonsVal(value)
|
|
|
}
|
|
|
</script>
|