# ai-pack **Repository Path**: luoyukun1/ai-pack ## Basic Information - **Project Name**: ai-pack - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-14 - **Last Updated**: 2021-08-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 介绍 **_tsl-project-template_** 是一个基于 Vue.js 进行快速开发的完整系统模,意在快速搭建项目,便捷开发业务项目。 - V2 版本:基于 vue(2.6.11) - V3 版本:基于 vue(3.0.0)【待优化】 #### 安装 - 设置镜像源 由于团队内部使用 Nexus 管理 npm 包,先设置镜像源 ```bash npm config set registry https://registry.npm.taobao.org ``` - 脚手架 tsl-cli 是提供的脚手架工具,通过 tsl-cli 初始化你的项目 ```bash yarn global add tsl-cli ``` ```bash tsl-cli init ``` #### 国际化 国际化基于 Vue I18n 实现,详情配置请参照[https://kazupon.github.io/vue-i18n/zh/](https://kazupon.github.io/vue-i18n/zh/) 这里将列举常用配置 - 本组件默认已开启延迟加载翻译(一次加载所有翻译文件是过度和不必要的) - 初始化: ```javascript import Vue from "vue"; import App from "./App.vue"; import { tslI18n } from "tsl-vue-instinct"; new Vue({ render: (h) => h(App), i18n: tslI18n.init("zh") //'zh'为默认语言包名称,会加载/src/assets/lang下的zh.json文件 }).$mount("#app"); ``` - 语言环境获取与变更: ```javascript import { tslI18n } from "tsl-vue-instinct"; tslI18n.setLang("zh"); console.log(tslI18n.getLang()); ``` - 需要在语言包目录路径: src/assets/lang 添加所支持的语言包文件,格式例如 zh.json ```javascript { "sidebar": { "/": "首页", "/blank": "空白页", "listName": "列表合集" }, "hello": { "title": "你好,特斯联!", "changeBtn": "变更语言" } } ``` - i8n 官网其它配置,如日期格式化,数字本地化,如下初始化: ```javascript import { tslI18n } from "tsl-vue-instinct"; new Vue({ render: (h) => h(App), i18n: tslI18n.init("zh", { dateTimeFormats, numberFormats }) }).$mount("#app"); ``` #### 网络请求 项目模板已内置网络请求库:tsl-axios,使用方式请参考项目示例