You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spirit2020
e7b534cc6d
|
3 years ago | |
---|---|---|
api | 3 years ago | |
common | 3 years ago | |
components/cp-button | 3 years ago | |
hybrid/html | 3 years ago | |
keystore | 3 years ago | |
locale | 3 years ago | |
pages | 3 years ago | |
static | 3 years ago | |
store | 3 years ago | |
uni_modules/mescroll-uni | 3 years ago | |
uview-ui | 3 years ago | |
.gitignore | 3 years ago | |
App.vue | 3 years ago | |
README.md | 3 years ago | |
app.config.js | 3 years ago | |
index.html | 3 years ago | |
main.js | 3 years ago | |
manifest.json | 3 years ago | |
pages.json | 3 years ago | |
uni.scss | 3 years ago |
README.md
uni-tpl
没有用到的不要引入, 否则会被打包进项目
分包
pages 下的一级目录
国际化
https://uniapp.dcloud.io/collocation/i18n?id=pages
npm install i18n --save
main.js
import en from './locale/en.json'
import zhHans from './locale/zh-Hans.json'
const messages = {
en,
'zh-Hans': zhHans,
}
let i18nConfig = {
locale: uni.getLocale(),
messages
}
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
const i18n = new VueI18n(i18nConfig)
const app = new Vue({
i18n,
...App
})
组件库
api
一个页面需要多个模块
import {LoginApi, UserApi} from '@/api'
一个页面只需一个模块
import LoginApi from '@/api/modules/Login'