开源项目 `mdn/web-components-examples` 使用教程

开源项目 mdn/web-components-examples 使用教程

web-components-examplesA series of web components examples, related to the MDN web components documentation at https://developer.mozilla.org/en-US/docs/Web/Web_Components.项目地址:https://gitcode.com/gh_mirrors/we/web-components-examples

项目目录结构及介绍

mdn/web-components-examples 是一个展示 Web Components 技术的示例项目。项目的目录结构如下:

web-components-examples/
├── accordion
├── animated-height-transition
├── attribute-change-events
├── basics
├── carousel
├── custom-elements-es5-adapter.js
├── element-details
├── events
├── expanding-list
├── filter-only-inputs
├── form-associated
├── fullscreen
├── lifecycle-callbacks
├── light-dom
├── menu-button
├── model-viewer
├── more-capable-form-controls
├── native-form-widgets
├── popups
├── product-compare
├── reusable-animations
├── search-highlight
├── slot-replacement
├── slotchange-event
├── slotted-pseudo-element
├── spinner
├── tabbed-panel
├── template
├── text-classification
├── todo-list
├── tooltips
├── unstoppable-events
├── web-components-examples.code-workspace
└── web-components-todo

每个子目录代表一个独立的示例,展示了 Web Components 的不同特性和用法。例如:

  • accordion:展示如何创建一个手风琴组件。
  • carousel:展示如何创建一个轮播图组件。
  • todo-list:展示如何创建一个简单的待办事项列表组件。

项目的启动文件介绍

每个示例目录中通常包含一个或多个 HTML 文件,这些文件是示例的入口点。例如,在 accordion 目录中,有一个 index.html 文件,这是该示例的启动文件。

<!-- accordion/index.html -->
<!DOCTYPE html>
<html lang="en-US">
<head>
  <meta charset="utf-8">
  <title>Accordion</title>
  <link rel="stylesheet" href="style.css">
  <script src="main.js" defer></script>
</head>
<body>
  <h1>Accordion</h1>
  <accordion-element>
    <details>
      <summary>Section 1</summary>
      <p>Content for section 1.</p>
    </details>
    <details>
      <summary>Section 2</summary>
      <p>Content for section 2.</p>
    </details>
  </accordion-element>
</body>
</html>

在这个示例中,index.html 文件引入了 style.cssmain.js 文件,分别用于样式和脚本逻辑。

项目的配置文件介绍

mdn/web-components-examples 项目本身并没有一个统一的配置文件,因为每个示例都是独立的。但是,一些示例可能会包含自己的配置文件,例如 package.jsonwebpack.config.js,用于管理依赖和构建过程。

例如,在某些示例目录中,你可能会找到 package.json 文件:

{
  "name": "accordion",
  "version": "1.0.0",
  "description": "A simple accordion component",
  "main": "index.html",
  "scripts": {
    "start": "serve"
  },
  "dependencies": {
    "serve": "^11.3.2"
  }
}

这个文件定义了项目的基本信息和启动命令。你可以使用 npm install 安装依赖,然后使用 npm start 启动本地服务器来运行示例。

总结来说,mdn/web-components-examples 项目通过多个独立的示例展示了 Web Components 的各种用法和特性。每个示例都有自己的启动文件和可能的配置文件,方便开发者学习和参考。

web-components-examplesA series of web components examples, related to the MDN web components documentation at https://developer.mozilla.org/en-US/docs/Web/Web_Components.项目地址:https://gitcode.com/gh_mirrors/we/web-components-examples

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
毕业设计,基于SpringBoot+Vue+MySQL开发的体育馆管理系统,源码+数据库+毕业论文+视频演示 现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本体育馆管理系统就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此体育馆管理系统利用当下成熟完善的SpringBoot框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发。实现了用户在线选择试题并完成答题,在线查看考核分数。管理员管理收货地址管理、购物车管理、场地管理、场地订单管理、字典管理、赛事管理、赛事收藏管理、赛事评价管理、赛事订单管理、商品管理、商品收藏管理、商品评价管理、商品订单管理、用户管理、管理员管理等功能。体育馆管理系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。 关键词:体育馆管理系统;SpringBoot框架;Mysql;自动化
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin. npm WARN deprecated microargs@1.1.2: This project has been renamed to @pawelgalazka/cli-args. Install using @pawelgalazka/cli-args instead npm WARN deprecated microcli@1.3.3: This project has been renamed to @pawelgalazka/cli . Install using @pawelgalazka/cli instead npm WARN deprecated @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information. npm WARN tarball tarball data for @jest/types@http://10.129.3.105:8081/repository/npm-all/@jest/types/-/types-27.5.1.tgz (sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==) seems to be corrupted. Trying again. npm WARN deprecated runjs@4.4.2: This project has been renamed to 'tasksfile'. Install using 'npm install tasksfile' instead. npm WARN tarball tarball data for @jest/console@http://10.129.3.105:8081/repository/npm-all/@jest/console/-/console-27.5.1.tgz (sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==) seems to be corrupted. Trying again. npm WARN tarball tarball data for @jest/test-result@http://10.129.3.105:8081/repository/npm-all/@jest/test-result/-/test-result-27.5.1.tgz (sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==) seems to be corrupted. Trying again. npm WARN deprecated svgo@1.2.0: This SVGO version is no longer supported. Upgrade to v2.x.x. npm WARN tarball tarball data for @jest/types@http://10.129.3.105:8081/repository/npm-all/@jest/types/-/types-27.5.1.tgz (sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==) seems to be corrupted. Trying again. npm WARN tarball tarball data for @jest/console@http://10.129.3.105:8081/repository/npm-all/@jest/console/-/console-27.5.1.tgz (sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==) seems to be corrupted. Trying again. npm WARN tarball tarball data for @jest/test-result@http://10.129.3.105:8081/repository/npm-all/@jest/test-result/-/test-result-27.5.1.tgz (sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==) seems to be corrupted. Trying again.
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

解洲思Ronald

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值