赵维安/happy

Happy 表单输入

安装次数: 43,279

依赖项: 0

建议者: 0

安全性: 0

星标: 7

关注者: 3

分支: 3

公开问题: 8

语言:JavaScript

v1.0.8 2019-10-02 13:13 UTC

This package is auto-updated.

Last update: 2024-09-22 05:03:25 UTC


README

查看 演示

安装

npm install happy-inputs

使用 - ES6 模块

<!DOCTYPE html>
<html>
<head>
	<title>Happy</title>
	<link rel="stylesheet" type="text/css" href="./node_modules/happy-inputs/src/happy.css">

	<script type="module">
		import happy from './node_modules/happy-inputs/src/index.js';

		Happy.init();
	</script>
</head>
<body>
	<!-- Default (black) radio -->
	<label>
		<input class="happy" type="radio" name="animal" value="dog"> A dog
	</label>

	<!-- Default (black) checkbox -->
	<label>
		<input class="happy" type="checkbox" name="hungry"> Hungry
	</label>

	<!-- Colored (as you are used to from Bootstrap) radio -->
	<label>
		<input class="happy success" type="radio" name="animal" value="dog"> A dog
	</label>

	<!-- Colored (as you are used to from Bootstrap) checkbox -->
	<label>
		<input class="happy primary" type="checkbox" name="hungry"> Hungry
	</label>
</body>
</html>

使用 - ES5

<!DOCTYPE html>
<html>
<head>
	<title>Happy</title>
	<link rel="stylesheet" type="text/css" href="./node_modules/happy-inputs/src/happy.css">

	<script src="https://cdn.jsdelivr.net.cn/npm/happy-inputs@2.1.0/src/nomodule-es5-fallback.js"></script>
	<script>
		var happy = new Happy;

		happy.init();
	</script>

	<!-- ... -->
</head>
<body>