1.0.30 • Published 6 months ago

sadais-core v1.0.30

Weekly downloads
18
License
MIT
Repository
github
Last release
6 months ago

使用本库依赖列表

安装

项目src目录定义consts.js文件进行变量覆盖

// 引入核心业务
import sadaisCore from 'sadais-core'
Vue.use(sadaisCore)
  1. sadais-piui

uni.scss建议和sadais-core一直的consts配置

$STATIC_BASE_URL: 'https://m.sadais.com';
$STATIC_FONT_URL: $STATIC_BASE_URL + '/huafa/marketing-activities-uniapp/static/font/';
$STATIC_IMG_URL: $STATIC_BASE_URL + '/huafa/marketing-activities-uniapp/static/img/';

consts的引用

js里面用

不要直接应用sadais-core/const或者@/src/consts,sadais-core会进行一次合并,正确的使用方式是

this.$consts.API_BASE_URL

import { getConsts } from 'sadais-core/consts'
getConsts('API_BASE_URL')
getConsts().API_BASE_URL

在模板用

<pi-img :src="$consts.get('STATIC_IMG_URL') + 'home_bg_banner.png'" />

request的使用

request基于luch-request二次封装 https://www.quanzhan.co/luch-request/guide/3.x/#%E4%BB%8B%E7%BB%8D

import request from 'sadais-core/core/request'

/**
 * 获取活动信息
 * @param {String} activityId 活动id
 */
export const apiGetActivity = async activityId => {
  const params = {}
  if (activityId) params.activityId = activityId
  const { data } = await request.get('/api/v1/activity/info')
  return data
}
2.0.2

6 months ago

2.0.1

7 months ago

1.0.29

7 months ago

1.0.30

6 months ago

2.0.0

7 months ago

1.0.28

11 months ago

1.0.27

2 years ago

1.0.22-beta1

2 years ago

1.0.22

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago