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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@talknote/create-talknote-h5

v0.1.4

Published

Create a Talknote Alita H5 project.

Readme

帮助你快速使用 alita,基于Umi.js 的移动端框架

yarn
yarn dev

首页

image

列表页

列表页支持滚动加载更多,固定头部,状态保持

image

关于尺寸标注

100% 宽为 750px,可在蓝湖等工具中将标准改为 750px,这样可以直接使用标注的尺寸用于 caa class 中的尺寸,最终运行会根据手机适配,将 px 自动转为对应的 rem 值。

值得注意的是,写在内联样式 style 中的 px 值不会被转化,需要手动写明 rem 单位,直接将 px 值除于 100 即可,如 750px,在 style 中应该写为 7.5rem

关于路由

采用约定式路由,只有 src/pages/**/index.tsx 会被识别成路由,可使用 npx alita g pages name 来新增页面。

Q: 为什么仅 index.tsx 会被识别成路由?如果我想要嵌套的路由,如 hello/hero 我该怎么办? A: 仅 index.tsx 被识别成路由,会让整个文件结构变得很干净,在移动端上不需要嵌套路由,一般短位链接优势更大

自带头部

可在 src/app.tsx#L24 中配置

const titleList: TitleListItem[] = [
  {
    pagePath: '/',
    title: '首页',
  },
  {
    pagePath: '/list',
    title: '列表',
  },
];

可全局配置隐藏

const navBar: NavBarProps = {
  navList,
  fixed: false,
  //默认导航栏显示
  hideNavBar: false,
  onLeftClick: () => {
    // router.goBack();
  },
};

也可以在页面中独立配置

import { setPageNavBar, useLocation } from 'alita';
import { LeftOutline } from 'antd-mobile-icons';
import { useEffect } from 'react';

const location = useLocation();
useEffect(() => {
  setPageNavBar({
    pagePath: location.pathname,
    navBar: {
      mode: 'dark',
      pageTitle: '首页动态标题',
      pageBackground: '#fff',
      back: '返回',
      icon: <LeftOutline />,
      leftContent: <div>首页</div>,
      rightContent: <div>详情</div>,
      onLeftClick: (navigate) => {
        navigate(-1);
      },
      hideNavBar: false,
    },
  });
}, []);

关闭默认 NavBar 上述 hideNavBar 配置改为 hideNavBar: true

底部 Tabs

可在 src/app.tsx#L42 中配置

const tabList: TabBarListItem[] = [
  {
    pagePath: '/',
    text: '首页',
    iconPath: HomeGary,
    selectedIconPath: HomeBlue,
    title: '首页',
    iconSize: '',
    badge: '',
  },
  {
    pagePath: '/list',
    text: '列表',
    iconPath: ListGary,
    selectedIconPath: ListBlue,
    title: '列表',
    iconSize: '',
    badge: '',
  },
];

也可以在页面中独立配置

import { setTabBarList, useLocation } from 'alita';
import { useEffect } from 'react';

const location = useLocation();
useEffect(() => {
  setTabBarList({
    pagePath: location.pathname,
    text: '首页',
    iconSize: '18px',
    badge: '12',
    onPress: () => {
      navigate(location.pathname, { replace: true });
      return '';
    },
    remove: false,
  });
}, []);

关闭 app.ts 中已经配置好的 Tab ,上述 remove 配置改为 remove: true

格式化

yarn format

构建

yarn build

调试工具

config/config.ts 中增加配置

aconsole: {
    console: {},
    inspx: {},
},