Commit e2895baf by 芋道源码 Committed by Gitee

!15 修复了一些小问题

Merge pull request !15 from puhui999/master
parents 03bf50d6 585a6673
......@@ -33,12 +33,15 @@ export default defineComponent({
if (!props.type) {
return null
}
if (!props.value) {
// 解决自定义字典标签值为零时标签不渲染的问题
if (!props.value && props.value !== 0) {
return null
}
getDictObj(props.type, props.value.toString())
// 添加标签的文字颜色为白色,解决自定义背景颜色时标签文字看不清的问题
return (
<ElTag
style={dictData.value?.cssClass ? 'color: #fff' : ''}
type={dictData.value?.colorType}
color={
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
......
......@@ -30,7 +30,7 @@ const removeStyles = () => {
//移除引入的文件名
const targetelement = 'style'
const targetattr = 'id'
let allsuspects = document.getElementsByTagName(targetelement)
const allsuspects = document.getElementsByTagName(targetelement)
for (let i = allsuspects.length; i >= 0; i--) {
if (
allsuspects[i] &&
......@@ -43,8 +43,8 @@ const removeStyles = () => {
}
}
const reImport = () => {
let head = document.getElementsByTagName('head')[0]
let style = document.createElement('style')
const head = document.getElementsByTagName('head')[0]
const style = document.createElement('style')
style.innerText = styleCss
style.id = 'cssTheme'
head.appendChild(style)
......@@ -52,10 +52,10 @@ const reImport = () => {
watch(
() => appStore.getIsDark,
() => {
if (appStore.getIsDark == true) {
if (appStore.getIsDark) {
reImport()
}
if (appStore.getIsDark == false) {
if (!appStore.getIsDark) {
removeStyles()
}
},
......
......@@ -11,10 +11,10 @@
>
<el-select v-model="bindMessageId" @change="updateTaskMessage">
<el-option
v-for="item in Object.keys(messageMap)"
:value="item"
:label="messageMap[item]"
:key="item"
v-for="key in Object.keys(messageMap)"
:value="key"
:label="messageMap[key]"
:key="key"
/>
</el-select>
<XButton
......
export {}
declare global {
declare interface Fn<T = any> {
(...arg: T[]): T
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment