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

@94ai/codepen

v4.0.5

Published

common-ui组件库es.browser和umd.browser版本

Downloads

253

Readme

@94ai/codepen

common-ui组件库es.browser和umd.browser版本

HomePage

官网地址: https://oss.xccjh.top/common-ui/#/ai-index

Usage

importmap+common-ui.es.browser.js

common-ui支持原生es模块化使用,如下:

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="https://unpkg.com/[email protected]/lib/theme-chalk/index.css"> <!--  引入element-ui主题  -->
  <link rel="stylesheet" href="https://unpkg.com/@94ai/[email protected]/lib/css/index.css"> <!--  引入common-ui主题  -->
</head>
<body>

<script type="importmap">
{
  "imports": {
     "vue":"https://unpkg.com/[email protected]/dist/vue.esm.browser.js",
     "common-ui":"https://unpkg.com/@94ai/[email protected]/lib/codepen/common-ui.es.browser.js"
  }
}
</script>
<script type="module">
import {
  default as Vue
} from 'vue'
if (!window.Vue) {
  window.Vue = Vue
}
</script>
<script defer src="https://unpkg.com/[email protected]/lib/index.js"></script>
<script type="module">
import { NfButtonDemo, NfDoubleTime } from 'common-ui'
Vue.use(NfButtonDemo).use(NfDoubleTime)
new Vue({
  el: '#app'
})
</script>
<div id="app">
  <el-button>test element-ui</el-button>
  <nf-button-demo>test common-ui</nf-button-demo>
  <nf-double-time/>
</div>
</body>
</html>

效果如下:

直接在html中使用umd组件

如下引入对应主题包和库文件即可

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="renderer" content="webkit">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>umd demo</title>
  <script src="//unpkg.com/vue@2/dist/vue.js"></script> <!--  👈  引入vue  -->
  <link rel="stylesheet" href="https://unpkg.com/[email protected]/lib/theme-chalk/index.css">
  <script src="https://unpkg.com/[email protected]/lib/index.js"></script> <!--  👈  引入element-ui的全量umd版本  -->
  <link rel="stylesheet" href="https://unpkg.com/@94ai/[email protected]/lib/css/index.css"> 
  <script src="https://unpkg.com/@94ai/[email protected]/lib/codepen/common-ui.umd.browser.js"></script> <!--  👈  引入common-ui的全量umd版本  -->
</head>
<body>
<div id="app">
  <el-button>test element-ui</el-button>
  <nf-button-demo>test common-ui</nf-button-demo> <!--  👈 使用组件 -->
  <nf-double-time></nf-double-time>
</div>
</body>
<script>
const { default: CommonUI } = window['common-ui']
Vue.use(CommonUI)  // 👈  注册common-ui
new Vue().$mount('#app')
</script>
</html>

打开查看效果:

温馨提示 由于vue cdn通过file协议通常加载不到,推荐使用托管的形式打开,如npx http-server