Skip to content

Commit

Permalink
@mdui/shared v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zdhxiong committed Oct 16, 2023
1 parent b8bd3cd commit 816ff6b
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/components/collapse.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ import type { CollapseItem } from 'mdui/components/collapse-item.js';
<mdui-collapse-item trigger=".example-trigger">
<mdui-list-item slot="header" icon="near_me">
Item 1
<mdui-icon slot="end" class="example-trigger" name="keyboard_arrow_down"></mdui-icon>
<mdui-icon slot="end-icon" class="example-trigger" name="keyboard_arrow_down"></mdui-icon>
</mdui-list-item>
<div style="margin-left: 2.5rem">
<mdui-list-item>Item 1 - subitem</mdui-list-item>
Expand Down
54 changes: 27 additions & 27 deletions docs/functions/jq.md
Original file line number Diff line number Diff line change
Expand Up @@ -1835,10 +1835,10 @@ $(document).on('ajaxComplete', function (e, { xhr, options }) {
<td colspan="3">
<p>设置在 XMLHttpRequest 对象上的数据。</p>
<pre><code class="language-js">$.ajax({
url: '一个跨域 URL',
xhrFields: {
withCredentials: true
}
url: '一个跨域 URL',
xhrFields: {
withCredentials: true
}
});</code></pre>
</td>
</tr>
Expand All @@ -1851,14 +1851,14 @@ xhrFields: {
<td colspan="3">
<p>HTTP 状态码和函数组成的对象。</p>
<pre><code class="language-js">$.ajax({
statusCode: {
404: function (xhr, textStatus) {
alert('返回状态码为 404 时被调用');
},
200: function (data, textStatus, xhr) {
alert('返回状态码为 200 时被调用');
statusCode: {
404: function (xhr, textStatus) {
alert('返回状态码为 404 时被调用');
},
200: function (data, textStatus, xhr) {
alert('返回状态码为 200 时被调用');
}
}
}
});</code></pre>
<p>状态码在 200 - 299 之间、或状态码为 304 时,表示请求成功,函数参数和 <code>success</code> 回调的参数相同;否则表示请求失败,函数参数和 <code>error</code> 回调的参数相同。</p>
</td>
Expand Down Expand Up @@ -1907,9 +1907,9 @@ statusCode: {
<td colspan="3">
<p>在请求发送之前调用。返回 <code>false</code> 时将取消 AJAX 请求。</p>
<pre><code class="language-js">$.ajax({
beforeSend: function (xhr) {
// xhr 为 XMLHttpRequest 对象
}
beforeSend: function (xhr) {
// xhr 为 XMLHttpRequest 对象
}
});</code></pre>
</td>
</tr>
Expand All @@ -1922,11 +1922,11 @@ beforeSend: function (xhr) {
<td colspan="3">
<p>请求成功之后调用。</p>
<pre><code class="language-js">$.ajax({
success: function (data, textStatus, xhr) {
// data 为 AJAX 请求返回的数据
// textStatus 为包含成功代码的字符串
// xhr 为 XMLHttpRequest 对象
}
success: function (data, textStatus, xhr) {
// data 为 AJAX 请求返回的数据
// textStatus 为包含成功代码的字符串
// xhr 为 XMLHttpRequest 对象
}
});</code></pre>
</td>
</tr>
Expand All @@ -1939,10 +1939,10 @@ success: function (data, textStatus, xhr) {
<td colspan="3">
<p>请求出错时调用。</p>
<pre><code class="language-js">$.ajax({
error: function (xhr, textStatus) {
// xhr 为 XMLHttpRequest 对象
// textStatus 为包含错误代码的字符串
}
error: function (xhr, textStatus) {
// xhr 为 XMLHttpRequest 对象
// textStatus 为包含错误代码的字符串
}
});</code></pre>
</td>
</tr>
Expand All @@ -1955,10 +1955,10 @@ error: function (xhr, textStatus) {
<td colspan="3">
<p>请求完成时调用,无论请求成功或失败。</p>
<pre><code class="language-js">$.ajax({
complete: function (xhr, textStatus) {
// xhr 为 XMLHttpRequest 对象
// textStatus 为一个包含成功或错误代码的字符串
}
complete: function (xhr, textStatus) {
// xhr 为 XMLHttpRequest 对象
// textStatus 为一个包含成功或错误代码的字符串
}
});</code></pre>
</td>
</tr>
Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ import { throttle } from 'mdui/functions/throttle.js';</code></pre>
这个例子使用全局构建版本的 mdui,所有函数都以属性的形式暴露在全局对象 `mdui` 上:

```html
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.0/mdui.css">
<script src="https://unpkg.com/mdui@2.0.0/mdui.global.js"></script>
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.1/mdui.css">
<script src="https://unpkg.com/mdui@2.0.1/mdui.global.js"></script>

<mdui-button class="btn">点我</mdui-button>

Expand All @@ -150,12 +150,12 @@ import { throttle } from 'mdui/functions/throttle.js';</code></pre>
这个例子使用 ES 模块构建版本的 mdui,你可以使用 ES 模块语法从 CDN 导入:

```html
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.0/mdui.css">
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.1/mdui.css">

<mdui-button class="btn">点我</mdui-button>

<script>
import { snackbar } from 'https://unpkg.com/mdui@2.0.0/mdui.esm.js';
import { snackbar } from 'https://unpkg.com/mdui@2.0.1/mdui.esm.js';
document.querySelector('.btn').addEventListener('click', () => {
snackbar({ message: '点击了按钮' });
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
将下面代码添加到页面的 `<head>` 标签中:

```html
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.0/mdui.css">
<script src="https://unpkg.com/mdui@2.0.0/mdui.global.js"></script>
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.1/mdui.css">
<script src="https://unpkg.com/mdui@2.0.1/mdui.global.js"></script>
```

mdui 不依赖任何第三方库,引入上面两个文件后,就能正常工作了。
Expand All @@ -34,8 +34,8 @@ mdui 不依赖任何第三方库,引入上面两个文件后,就能正常工
<meta name="renderer" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.0/mdui.css">
<script src="https://unpkg.com/mdui@2.0.0/mdui.global.js"></script>
<link rel="stylesheet" href="https://unpkg.com/mdui@2.0.1/mdui.css">
<script src="https://unpkg.com/mdui@2.0.1/mdui.global.js"></script>

<title>Hello, world!</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdui/icons",
"version": "1.0.0",
"version": "1.0.1",
"description": "Material Icons 的 Web Components 图标组件库",
"type": "module",
"files": [
Expand All @@ -27,7 +27,7 @@
},
"homepage": "https://github.com/zdhxiong/mdui",
"dependencies": {
"@mdui/shared": "workspace:*",
"@mdui/shared": "workspace:^",
"lit": "^2.7.5",
"tslib": "^2.6.0"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/mdui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdui",
"version": "2.0.0",
"version": "2.0.1",
"description": "实现 material you 设计规范的 Web Components 组件库",
"type": "module",
"main": "mdui.js",
Expand Down Expand Up @@ -48,8 +48,8 @@
"dependencies": {
"@lit-labs/motion": "^1.0.3",
"@material/material-color-utilities": "^0.2.7",
"@mdui/shared": "workspace:*",
"@mdui/jq": "workspace:*",
"@mdui/shared": "workspace:^",
"@mdui/jq": "workspace:^",
"@open-wc/dedupe-mixin": "^1.3.1",
"classcat": "^5.0.4",
"is-promise": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdui/shared",
"version": "1.0.0",
"version": "1.0.1",
"description": "mdui 项目的公共部分",
"type": "module",
"files": [
Expand All @@ -26,7 +26,7 @@
},
"homepage": "https://github.com/zdhxiong/mdui#readme",
"dependencies": {
"@mdui/jq": "workspace:*",
"@mdui/jq": "workspace:^",
"@open-wc/dedupe-mixin": "^1.3.1",
"lit": "^2.7.5",
"ssr-window": "^4.0.2",
Expand Down

0 comments on commit 816ff6b

Please sign in to comment.