1.0.3 • Published 12 months ago

@mt-kit/components v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

micro-rc-container

下载

npm i @mt-kit/components

API

cssGenerateTriangle

css 三角形

import {
    cssGenerateTriangle
} from "@mt-kit/components";

<div style=`${cssGenerateTriangle("red", 10)}`></div>

imitationViteError

生成一个类似 Vite 报错的提示

import {
    imitationViteError
} from '@mt-kit/components';

const overlay = imitationViteError(err);

document.body.appendChild(overlay);

// 或

获取到的页面元素.appendChild(overlay);

draggable

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo-draggable</title>
    <style>
        html, body {
            height: 100%;
            width: 100%;
            overflow: hidden;
            margin: 0;
        }
        div {
            display: inline-block;
            position: relative;
        }
    </style>
</head>
<body>
    <div>
        <div class="demo-draggable-test01">
            拖动1
        </div>
        <div class="demo-draggable-test02">
            拖动2
        </div>
    </div>
</body>
</html>
<script type="module">
    import { draggable } from '@mt-kit/components'
    const el = document.querySelector(".demo-draggable-test01");
    draggable(el)
    const el2 = document.querySelector(".demo-draggable-test02");
    draggable(el2, true)
</script>
1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago