提交 1b3ac313 作者: 方治民

chore(config): 更新 app log 输出样式

上级 ad68a92f
import type { App } from 'vue'
const config: Application = { const config: Application = {
name: __APP__.name, name: __APP__.name,
version: __APP__.version, version: __APP__.version,
...@@ -8,16 +10,20 @@ const config: Application = { ...@@ -8,16 +10,20 @@ const config: Application = {
export const $app = config export const $app = config
export function setupAppConfig() { export function setupAppConfig(app: App<Element>) {
// 打印 App 信息 // 打印 App 信息
const block = Array(50).fill('=').join('') console.log(
const infos: string[] = [] `%c APP %c ${config.name} %c V${config.version} `,
infos.push(block) 'padding: 2px 1px; border-radius: 3px; color: #fff; background: #fa593b; font-weight: bold; margin-right: 5px;',
infos.push(`[App] name: ${config.name}`) 'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;',
infos.push(`[App] version: ${config.version}`) 'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
infos.push(`[App] description: ${config.description}`) )
infos.push(`[App] author: ${config.author.name} ${config.author.url}`)
infos.push(`[App] lastBuildTime: ${config.lastBuildTime}`) app.config.globalProperties.$app = $app
infos.push(block) }
console.log('%c' + infos.join('\n'), 'color: violet;')
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$app: Application
}
} }
...@@ -25,8 +25,8 @@ if (isDevMode()) { ...@@ -25,8 +25,8 @@ if (isDevMode()) {
async function bootstrap() { async function bootstrap() {
const app = createApp(App) const app = createApp(App)
// App 配置 // 注册 App 配置
setupAppConfig() setupAppConfig(app)
// Configure store // Configure store
// 配置 store // 配置 store
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论