docs(fix): fix docs (#1128)

This commit is contained in:
申君健 2023-12-14 15:42:08 +08:00 committed by GitHub
parent 41c608fbbd
commit eda5b4f86e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 40 additions and 116 deletions

View File

@ -50,7 +50,7 @@ export default {
'zh-CN': '版型类型',
'en-US': 'Measurement type'
},
'demoId': 'custom-container'
'demoId': 'basic-usage'
},
{
'name': 'aside-width',

View File

@ -155,7 +155,7 @@ export default {
'en-US':
'After lazy loading is enabled, the container listens for the scroll event. The default value of this property is the parent element of the last overflow value being auto or scroll'
},
'demoId': 'lazy'
'demoId': ''
},
{
'name': 'preview-src-list',
@ -172,7 +172,7 @@ export default {
'zh-CN': '设置图片预览外层元素的 z-index',
'en-US': 'Set the z-index of the image preview wrapper'
},
'demoId': 'preview'
'demoId': ''
}
],
'events': [

View File

@ -250,7 +250,7 @@ export default {
'en-US':
'The right offset of the child item is offset via the left property; it is recommended to use offset instead'
},
'demoId': 'offset'
'demoId': ''
},
{
'name': 'xs',

View File

@ -1,36 +0,0 @@
<template>
<div class="btns-container">
<tiny-button v-for="i in [1, 2, 3, 4, 5]" :key="i" @click="btnClick"> 按钮 {{ i }} </tiny-button>
</div>
<tiny-popover ref="popoverRef" :reference="referenceElm" :content="dynContent" width="200"> </tiny-popover>
</template>
<script setup lang="jsx">
import { ref, nextTick } from 'vue'
import { Popover as TinyPopover, Button as TinyButton } from '@opentiny/vue'
const referenceElm = ref(null)
const dynContent = ref('')
const popoverRef = ref()
function btnClick(ev) {
popoverRef.value.doClose() //
const btn = ev.target
referenceElm.value = btn
dynContent.value = '您刚刚点击了: ' + btn.innerText
nextTick(() => popoverRef.value.doShow())
}
</script>
<style scoped>
.btns-container {
display: flex;
flex-direction: column;
}
.tiny-button {
width: 100px;
margin: 0 0 16px 8px;
}
</style>

View File

@ -1,45 +0,0 @@
<template>
<div class="btns-container">
<tiny-button v-for="i in [1, 2, 3, 4, 5]" :key="i" @click="btnClick"> 按钮 {{ i }} </tiny-button>
</div>
<tiny-popover ref="popoverRef" :reference="referenceElm" :content="dynContent" width="200"> </tiny-popover>
</template>
<script>
import { Popover, Button } from '@opentiny/vue'
export default {
components: {
TinyPopover: Popover,
TinyButton: Button
},
data() {
return {
referenceElm: null,
dynContent: ''
}
},
methods: {
btnClick(ev) {
this.$refs.popoverRef.doClose() //
const btn = ev.target
this.referenceElm = btn
this.dynContent = '您刚刚点击了: ' + btn.innerText
this.$nextTick(() => this.$refs.popoverRef.doShow())
}
}
}
</script>
<style scoped>
.btns-container {
display: flex;
flex-direction: column;
}
.tiny-button {
width: 100px;
margin: 0 0 16px 8px;
}
</style>

View File

@ -4,8 +4,8 @@
width="200"
@show="show"
@hide="hide"
:after-leave="leave"
:after-enter="enter"
@after-leave="leave"
@after-enter="enter"
trigger="hover"
content="这是一段内容"
>

View File

@ -218,7 +218,7 @@ export default {
'zh-CN': '弹出层高度',
'en-US': 'Layer height'
},
'demoId': 'basic-usage'
'demoId': ''
},
{
'name': 'disabled',
@ -238,7 +238,7 @@ export default {
'demoId': 'trigger'
},
{
'name': 'modelValue',
'name': 'v-model / modelValue',
'type': 'boolean',
'defaultValue': 'false',
'desc': {

View File

@ -200,7 +200,7 @@ export default {
'demoId': 'basic-usage'
},
{
'name': 'modelValue',
'name': 'v-model / modelValue',
'type': 'string[]',
'defaultValue': '[]',
'desc': {
@ -518,7 +518,7 @@ export default {
'type': '(name: string) => void',
'defaultValue': '',
'desc': { 'zh-CN': '清空某个面板的搜索关键词', 'en-US': 'Clear the search keywords of a panel.' },
'demoId': 'manual-clear-query'
'demoId': 'custom-filter'
}
]
}

View File

@ -3,10 +3,10 @@
<tiny-tree :data="data" :icon="icon"></tiny-tree>
<tiny-tree
:data="data"
:expandIcon="expandIcon"
expandIconColor="red"
:shrinkIcon="shrinkIcon"
shrinkIconColor="blue"
:expand-icon="expandIcon"
expand-icon-color="red"
:shrink-icon="shrinkIcon"
shrink-icon-color="blue"
></tiny-tree>
</div>
</template>

View File

@ -3,10 +3,10 @@
<tiny-tree :data="data" :icon="icon"></tiny-tree>
<tiny-tree
:data="data"
:expandIcon="expandIcon"
expandIconColor="red"
:shrinkIcon="shrinkIcon"
shrinkIconColor="blue"
:expand-icon="expandIcon"
expand-icon-color="red"
:shrink-icon="shrinkIcon"
shrink-icon-color="blue"
></tiny-tree>
</div>
</template>

View File

@ -1,15 +1,15 @@
<template>
<div>
<tiny-tree lazy :load="load" :afterLoad="afterLoad" @load-data="loadedData"></tiny-tree>
<tiny-tree lazy :load="load" :after-load="afterLoad" @load-data="loadedData"></tiny-tree>
</div>
</template>
<script setup lang="jsx">
import { ref } from 'vue'
import { Tree as TinyTree } from '@opentiny/vue'
// node resolve
function load(node, resolve) {
// node resolve
// eslint-disable-next-line no-console
console.log('即将加载节点下级数据:', node)
// level =0
@ -37,9 +37,11 @@ function load(node, resolve) {
}
}
function afterLoad(data) {
// eslint-disable-next-line no-console
console.log('afterLoad属性触发', data)
}
function loadedData(data) {
// eslint-disable-next-line no-console
console.log('load-data 事件触发:', data)
}
</script>

View File

@ -1,6 +1,6 @@
<template>
<div>
<tiny-tree lazy :load="load" :afterLoad="afterLoad" @load-data="loadedData"></tiny-tree>
<tiny-tree lazy :load="load" :after-load="afterLoad" @load-data="loadedData"></tiny-tree>
</div>
</template>
@ -12,8 +12,9 @@ export default {
TinyTree: Tree
},
methods: {
// node resolve
load(node, resolve) {
// node resolve
// eslint-disable-next-line no-console
console.log('即将加载节点下级数据:', node)
// level =0
@ -41,9 +42,11 @@ export default {
}
},
afterLoad(data) {
// eslint-disable-next-line no-console
console.log('afterLoad属性触发', data)
},
loadedData(data) {
// eslint-disable-next-line no-console
console.log('load-data 事件触发:', data)
}
}

View File

@ -688,14 +688,14 @@ export default {
'zh-CN': '是否开启节点拖拽',
'en-US': 'Whether to enable the node dragging function'
},
'demoId': 'node-draggable'
'demoId': 'drag'
},
{
'name': 'allow-drag',
'type': '(node)=>boolean',
'defaultValue': '',
'desc': { 'zh-CN': '判断节点能否被拖拽', 'en-US': 'Whether a node can be dragged.' },
'demoId': 'allow-drag'
'demoId': 'drag'
},
{
'name': 'allow-drop',
@ -707,7 +707,7 @@ export default {
'en-US':
"Whether the target node can be placed during dragging. The type parameter has three situations: 'prev',' inner', and'next', which indicate that it is placed before the target node, inserted into the target node, and placed after the target node respectively"
},
'demoId': 'allow-drop'
'demoId': 'drag'
},
{
'name': 'show-contextmenu',
@ -717,7 +717,7 @@ export default {
'zh-CN': '是否启用右键菜单功能',
'en-US': 'Whether to enable the right-click menu function'
},
'demoId': 'node-draggable'
'demoId': 'contextmenu'
},
{
'name': 'accordion',
@ -747,7 +747,7 @@ export default {
'zh-CN': '是否在第一次展开某个树节点后才渲染其子节点',
'en-US': 'Whether to render child nodes after the first expansion of a tree node'
},
'demoId': 'other'
'demoId': ''
},
{
'name': 'show-check-easily',
@ -839,7 +839,7 @@ export default {
'zh-CN': '懒加载时,加载数据成功的事件;<br>参数说明:{data: 加载的数据}',
'en-US': 'During lazy loading, data is loaded successfully. <br> Parameter description: {data: loaded data}'
},
'demoId': 'check-op'
'demoId': 'lazy'
},
{
'name': 'node-drop',
@ -1039,7 +1039,7 @@ export default {
'demoId': 'node-hl'
},
{
'name': 'getNodeKey ',
'name': 'getNodeKey',
'type': '(node:object) => number',
'defaultValue': '',
'desc': {
@ -1049,7 +1049,7 @@ export default {
'demoId': 'node-hl'
},
{
'name': 'getNodePath ',
'name': 'getNodePath',
'type': '(key:string) => object[]',
'defaultValue': '',
'desc': {
@ -1066,7 +1066,7 @@ export default {
'zh-CN': '通过 key 设置某个节点的当前选中状态',
'en-US': 'Use key to set the selected status of a node'
},
'demoId': 'node-key'
'demoId': 'node-op'
},
{
'name': 'setCurrentNode',
@ -1076,7 +1076,7 @@ export default {
'zh-CN': '通过节点数据, 设置某个节点的当前选中状态',
'en-US': 'This section describes how to set the selected status of a node based on node data'
},
'demoId': 'node-key'
'demoId': 'node-op'
},
{
'name': 'expandAllNodes',
@ -1221,7 +1221,7 @@ export default {
'demoId': 'check-op'
},
{
'name': 'setCurrentRadio ',
'name': 'setCurrentRadio',
'type': '() => void',
'defaultValue': '',
'desc': {
@ -1261,7 +1261,7 @@ export default {
'demoId': 'edit'
},
{
'name': 'addNode ',
'name': 'addNode',
'type': '(node:object) => void',
'defaultValue': '',
'desc': {