npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sadais-core

v1.0.30

Published

sadais核心库

Downloads

12

Readme

使用本库依赖列表

安装

项目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
}