doc: update

pull/4606/head
tangjinzhou 2021-09-02 09:11:55 +08:00
parent 25b1e5a473
commit 3f01f1430c
9 changed files with 29 additions and 22 deletions

View File

@ -15,7 +15,7 @@ module.exports = {
plugins: ['markdown', 'jest', '@typescript-eslint'], plugins: ['markdown', 'jest', '@typescript-eslint'],
overrides: [ overrides: [
{ {
files: ['**/demo/*.md'], files: ['*.md'],
processor: 'markdown/markdown', processor: 'markdown/markdown',
rules: { rules: {
'no-console': 'off', 'no-console': 'off',

2
.gitignore vendored
View File

@ -75,3 +75,5 @@ site/dev.js
vetur/ vetur/
report.html report.html
site/src/router/demoRoutes.js

View File

@ -552,6 +552,7 @@ Involving changes:
```js ```js
// v1 // v1
// eslint-disable-next-line no-undef,no-unused-vars
validateFields((err, value) => { validateFields((err, value) => {
if (!err) { if (!err) {
// Do something with value // Do something with value
@ -563,6 +564,7 @@ Change to
```js ```js
// v2 // v2
// eslint-disable-next-line no-undef,no-unused-vars
validateFields().then(values => { validateFields().then(values => {
// Do something with value // Do something with value
}); });

View File

@ -555,6 +555,7 @@ export default {
```js ```js
// v1 // v1
// eslint-disable-next-line no-undef,no-unused-vars
validateFields((err, value) => { validateFields((err, value) => {
if (!err) { if (!err) {
// Do something with value // Do something with value
@ -566,6 +567,7 @@ validateFields((err, value) => {
```js ```js
// v2 // v2
// eslint-disable-next-line no-undef,no-unused-vars
validateFields().then(values => { validateFields().then(values => {
// Do something with value // Do something with value
}); });

View File

@ -28,8 +28,9 @@
"vetur" "vetur"
], ],
"scripts": { "scripts": {
"debugger": "vite serve examples", "predev": "node node_modules/esbuild/install.js",
"dev": "yarn routes && vite serve site", "debugger": "yarn predev && vite serve examples",
"dev": "yarn predev && yarn routes && vite serve site",
"test": "cross-env NODE_ENV=test WORKFLOW=true jest --config .jest.js", "test": "cross-env NODE_ENV=test WORKFLOW=true jest --config .jest.js",
"test:dev": "cross-env NODE_ENV=test jest --config .jest.js", "test:dev": "cross-env NODE_ENV=test jest --config .jest.js",
"compile": "node antd-tools/cli/run.js compile", "compile": "node antd-tools/cli/run.js compile",

View File

@ -73,6 +73,7 @@ export const createMarkdownRenderer = (options: MarkdownOptions = {}): MarkdownR
permalinkBefore: true, permalinkBefore: true,
permalinkSymbol: '#', permalinkSymbol: '#',
permalinkAttrs: () => ({ 'aria-hidden': true }), permalinkAttrs: () => ({ 'aria-hidden': true }),
tabIndex: false,
...options.anchor, ...options.anchor,
}) })
.use(toc, { .use(toc, {

View File

@ -85,7 +85,7 @@ import type { GlobalConfig } from '../App.vue';
import { GLOBAL_CONFIG } from '../SymbolKey'; import { GLOBAL_CONFIG } from '../SymbolKey';
import { computed, defineComponent, inject, onMounted, ref } from 'vue'; import { computed, defineComponent, inject, onMounted, ref } from 'vue';
import { CheckOutlined, SnippetsOutlined } from '@ant-design/icons-vue'; import { CheckOutlined, SnippetsOutlined } from '@ant-design/icons-vue';
import { Modal } from 'ant-design-vue'; // import { Modal } from 'ant-design-vue';
export default defineComponent({ export default defineComponent({
name: 'DemoBox', name: 'DemoBox',
components: { components: {
@ -117,11 +117,11 @@ export default defineComponent({
props.jsfiddle?.title[globalConfig.isZhCN.value ? 'zh-CN' : 'en-US'], props.jsfiddle?.title[globalConfig.isZhCN.value ? 'zh-CN' : 'en-US'],
); );
const warning = () => { const warning = () => {
Modal.warning({ // Modal.warning({
content: globalConfig.isZhCN // content: globalConfig.isZhCN
? '我们检测到你可能使用了 AdBlock 或 Adblock Plus它会影响到复制、展开代码等功能。 你可以将 Ant Design Vue 加入白名单,以便我们更好地提供服务。' // ? '使 AdBlock Adblock Plus Ant Design Vue 便'
: 'We have detected that you may have used AdBlock or Adblock Plus, which will affect functions such as copying and expanding code. You can add Ant Design Vue to the whitelist so that we can provide better services.', // : 'We have detected that you may have used AdBlock or Adblock Plus, which will affect functions such as copying and expanding code. You can add Ant Design Vue to the whitelist so that we can provide better services.',
}); // });
}; };
const iframeDemoKey = computed(() => { const iframeDemoKey = computed(() => {
return ( return (

View File

@ -1,6 +1,5 @@
<template> <template>
<article> <article>
hello
<section class="markdown"> <section class="markdown">
<h1> <h1>
{{ frontmatter.title }} {{ frontmatter.title }}

View File

@ -12,9 +12,9 @@ export default [
component: () => import('../../../components/alert/demo/index.vue'), component: () => import('../../../components/alert/demo/index.vue'),
}, },
{ {
path: 'anchor:lang(-cn)?', path: 'auto-complete:lang(-cn)?',
meta: {"category":"Components","type":"其他","cols":2,"title":"Anchor","cover":"https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg","subtitle":"锚点"}, meta: {"category":"Components","type":"数据录入","cols":2,"title":"AutoComplete","cover":"https://gw.alipayobjects.com/zos/alicdn/qtJm4yt45/AutoComplete.svg","subtitle":"自动完成"},
component: () => import('../../../components/anchor/demo/index.vue'), component: () => import('../../../components/auto-complete/demo/index.vue'),
}, },
{ {
path: 'avatar:lang(-cn)?', path: 'avatar:lang(-cn)?',
@ -22,9 +22,9 @@ export default [
component: () => import('../../../components/avatar/demo/index.vue'), component: () => import('../../../components/avatar/demo/index.vue'),
}, },
{ {
path: 'auto-complete:lang(-cn)?', path: 'back-top:lang(-cn)?',
meta: {"category":"Components","type":"数据录入","cols":2,"title":"AutoComplete","cover":"https://gw.alipayobjects.com/zos/alicdn/qtJm4yt45/AutoComplete.svg","subtitle":"自动完成"}, meta: {"category":"Components","type":"其他","title":"BackTop","cover":"https://gw.alipayobjects.com/zos/alicdn/tJZ5jbTwX/BackTop.svg","subtitle":"回到顶部"},
component: () => import('../../../components/auto-complete/demo/index.vue'), component: () => import('../../../components/back-top/demo/index.vue'),
}, },
{ {
path: 'badge:lang(-cn)?', path: 'badge:lang(-cn)?',
@ -32,9 +32,9 @@ export default [
component: () => import('../../../components/badge/demo/index.vue'), component: () => import('../../../components/badge/demo/index.vue'),
}, },
{ {
path: 'back-top:lang(-cn)?', path: 'breadcrumb:lang(-cn)?',
meta: {"category":"Components","type":"其他","title":"BackTop","cover":"https://gw.alipayobjects.com/zos/alicdn/tJZ5jbTwX/BackTop.svg","subtitle":"回到顶部"}, meta: {"category":"Components","type":"导航","title":"Breadcrumb","cover":"https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg","subtitle":"面包屑"},
component: () => import('../../../components/back-top/demo/index.vue'), component: () => import('../../../components/breadcrumb/demo/index.vue'),
}, },
{ {
path: 'button:lang(-cn)?', path: 'button:lang(-cn)?',
@ -42,9 +42,9 @@ export default [
component: () => import('../../../components/button/demo/index.vue'), component: () => import('../../../components/button/demo/index.vue'),
}, },
{ {
path: 'breadcrumb:lang(-cn)?', path: 'anchor:lang(-cn)?',
meta: {"category":"Components","type":"导航","title":"Breadcrumb","cover":"https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg","subtitle":"面包屑"}, meta: {"category":"Components","type":"其他","cols":2,"title":"Anchor","cover":"https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg","subtitle":"锚点"},
component: () => import('../../../components/breadcrumb/demo/index.vue'), component: () => import('../../../components/anchor/demo/index.vue'),
}, },
{ {
path: 'calendar:lang(-cn)?', path: 'calendar:lang(-cn)?',