4 Star 12 Fork 2

Gitee 极速下载 / alpine-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/alpinejs/alpine
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Alpine.js

Go to the Alpine docs for most things: Alpine Docs

You are welcome to submit updates to the docs by submitting a PR to this repo. Docs are located in the /packages/docs directory.

Stay here for contribution-related information.

Looking for V2 docs? here they are

Alpine Component Patterns

Contribution Guide:

Quickstart

  • clone this repo locally
  • run npm install & npm run build
  • Include the /packages/alpinejs/dist/cdn.js file from a <script> tag on a webpage and you're good to go!

Brief Tour

You can get everything installed with: npm install in the root directory of this repo after cloning it locally.

This repo is a "mono-repo" using npm workspaces for managing the packages. Each package has its own folder in the /packages directory.

Rather than having to run separate builds for each package, all package bundles are handled with the same command: npm run build

Here's a brief look at each package in this repo:

Package Description
alpinejs The main Alpine repo with all of Alpine's core
collapse A plugin for expanding and collapsing elements using smooth animations
csp A repo to provide a "CSP safe" build of Alpine
docs The Alpine documentation
focus A plugin that allows you to manage focus inside an element
history A plugin for binding data to query string parameters using the history API (name is likely to change)
intersect A plugin for triggering JS expressions based on elements intersecting with the viewport
mask A plugin for automatically formatting a text input field as a user types
morph A plugin for morphing HTML (like morphdom) inside the page intelligently
persist A plugin for persisting Alpine state across page loads

The compiled JS files (as a result of running npm run [build/watch]) to be included as a <script> tag for example are stored in each package's packages/[package]/dist directory.

Each package should at least have: a "cdn" build that is self-initializing and can be included using the src attribute in a <script defer> tag, and a module.[esm/cjs].js file that is used for importing as a JS module (cjs for node, esm for everything else).

The bundling for Alpine V3 is handled exclusively by ESBuild. All of the configuration for these builds is stored in the scripts/build.js file.

Testing

There are 2 different testing tools used in this repo: Cypress (for integration tests), and Jest (for unit tests).

All tests are stored inside the /tests folder under /tests/cypress and /tests/jest.

You can run them both from the command line using: npm run test

If you wish to only run cypress and open it's user interface (recommended during development), you can run: npm run cypress

If you wish to only run Jest tests, you can run npm run jest like normal and target specific tests. You can specify command line config options to forward to the jest command with -- like so: npm run jest -- --watch

# MIT License Copyright © 2019-2021 Caleb Porzio and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Alpine.js 是一个在基础的 DOM 上实现了类似 Vue/React 的双向绑定的一个框架,使用 Alpine.js 和 Vue/React 的一个很大的不同点就在于,他可 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mirrors/alpine-js.git
git@gitee.com:mirrors/alpine-js.git
mirrors
alpine-js
alpine-js
main

搜索帮助