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.
 
 
 
 

1.0 KiB

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
})

组件库

  • uview-ui
  • mescroll
    import {MescrollMixin, MescrollCompMixin} from '@/common/utils/mescroll-map'
    

api

一个页面需要多个模块

import {LoginApi, UserApi} from '@/api'

一个页面只需一个模块

import LoginApi from '@/api/modules/Login'