1.0.0 • Published 3 years ago

nvue-kernel v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

此插件专用于uni-app的nVue

  1. 在任意目录创建文件:config.js,结构如下:
const toast = {
	'h': '正在启动...',
	'l': '加载中...',
	'r': '读取中...',
	's': '保存中...',
};

const maps = {
	'index': '/app/home/index',
};

const config = {
	token: '密钥abcdefg,与后端统一',
	api: 'http://API接口地址',
	socket: 'ws://socket地址:8888',
};

export default {
	...config,
	toast,
	maps
}
  1. 在项目根目录App.vue: 其中config.js指向实际位置
<script>
	import config from '@/config/config';
	import kernel from '@/kernel/kernel';

	export default {
		computed: {
			kernel () {
				return new kernel(config);
			}
		}
	}
</script>
  1. 在每个实际的nvue文件顶部引入kernel:import '@/kernel';

  2. daf