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

@alicloud/xconsole-rc-dialog

v1.0.0-beta.5

Published

基于 fusion 的一个 Dialog

Readme

@alicloud/xconsole-rc-dialog

安装

tnpm i --save prop-types react react-dom @alife/next @alicloud/xconsole-rc-dialog

@alicloud/xconsole-rc-dialog 之前的是它的依赖,需要使用者安装。

转换你自己的模块

一般来说,不建议在自己代码里到处出现一个三方代码的引用,比较合理的做法是把这个三方包「桥接」成自己的本地模块(如果觉得需要写相对路径很麻烦,推荐用 webpack 的 alias 配置)。

比如在 src 下的 rc 目录下都是「自己」的组件。

rc/dialog/index.js

桥接 @alicloud/xconsole-rc-dialog 并添加必要的国际化。

import Dialog, {
  open,
  slide,
  alert as alert0,
  confirm as confirm0,
  prompt as prompt0,
  hocDialogContent,
  hocWrapper
} from '@alicloud/xconsole-rc-dialog';

import intl from ':intl';

import './index.less';

export default Dialog;

export {
  open,
  slide,
  hocDialogContent,
  hocWrapper
};

export const alert = (props, {
  ok = intl('_?op', {
    op: 'CONFIRM'
  })
} = {}) => alert0(props, {
  ok
});

export const confirm = (props, {
  ok = intl('_?op', {
    op: 'CONFIRM'
  }),
  cancel = intl('_?op', {
    op: 'CANCEL'
  })
} = {}) => confirm0(props, {
  ok,
  cancel
});

export const prompt = (message, value, {
  ok = intl('_?op', {
    op: 'CONFIRM'
  }),
  cancel = intl('_?op', {
    op: 'CANCEL'
  })
} = {}) => prompt0(message, value, {
  ok,
  cancel
});

rc/dialog/index.less

@import (inline) '~@alicloud/xconsole-rc-dialog/dist/index.css';

使用

promise

这是最常用也是最简便的用法。

import {
  slide
} from ':rc/dialog';

export default () => slide({
  title,
  content,
  buttons
});

组件

如果特别有必要的情况(比如一个组件的实例不想被删除的情况)。

import React from 'react';

import Dialog from ':rc/dialog';

export default class extends React.Component {
  static displayName = 'SomeComponent';

  render() {
    const {
      props: {
        visible
      }
    } = this;

    if (!visible) {
      return null;
    }

    return <Dialog {...{
      title,
      content,
      mode: 'slide',
      buttons,
      onClose // 你需要用它
    }} />;
  }
}

FAQ

如何关闭

如果是 Promise 的用法,你可以不必顾虑,它会自动关闭,关闭的同时,Promiseresolvereject(你此时无法监听 onClose)。

如果是组件用法,你需要在 props 中添加 onClose,并且自己控制是否渲染 Dialog

待补充,可直接问 @驳是。