feat(vue-theme): add theme-tool version in style attribute (#872)

This commit is contained in:
gimmyhehe 2023-11-20 00:56:40 -08:00 committed by GitHub
parent b64a63166e
commit 10ea4d1f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,7 @@
*/
import definedComponents from './theme.config'
import packageJson from '../package.json'
/**
* TinyVue主题切换类 负责CSS变量主题的装卸主题元数据转换成主题数据
@ -75,6 +76,7 @@ export default class TinyThemeTool {
this.contentElement.textContent = this.formatCSSVariables(currentTheme.data)
this.contentElement.setAttribute('tiny-theme', this.currentTheme.id)
this.contentElement.setAttribute('version', packageJson.version)
}
// 通过 `组件css变量`,来推导出组件名: 从 ti-checkbox-button-bg-color 推导出 checkbox-button

View File

@ -11,6 +11,7 @@
*/
import definedComponents from './theme.config'
import packageJson from '../package.json'
/**
* TinyVue主题切换类 负责CSS变量主题的装卸主题元数据转换成主题数据
@ -72,8 +73,8 @@ export default class TinyThemeTool {
}
}
this.contentElement.textContent = this.formatCSSVariables(currentTheme.data)
this.contentElement.setAttribute('tiny-theme', this.currentTheme.id)
this.contentElement.setAttribute('version', packageJson.version)
}
// 通过 `组件css变量`,来推导出组件名: 从 ti-checkbox-button-bg-color 推导出 checkbox-button