一个小技巧,分享下在webapp中友好展示当前app信息的方法
实现效果

代码实现
- 导入
            
            
              js
              
              
            
          
          	import {
		version,
		name
	} from './package.json'- 应用声明周期中处理
            
            
              js
              
              
            
          
          onLaunch: function() {
// #ifdef H5
	console.log(
		`%c hello uniapp %c v${version} `,
		'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff',
		'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0;  color: #fff; font-weight: bold;'
	)
	console.log(`%c hello uniapp %c v${name} `,
		'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff',
		'background:#5500ff ;padding: 1px; border-radius: 0 3px 3px 0;  color: #fff; font-weight: bold;')
// #endif
}可以根据自己的实际需要,完善需要展示的信息,配色,内容。