@opentiny/vue-docs 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demos/app/chart/webdoc/chart.js +13 -13
- package/index.html +1 -0
- package/md.extend.config.js +6 -30
- package/package.json +7 -7
- package/playground/App.vue +25 -23
- package/src/views/components/components.vue +8 -1
- package/vite.config.js +0 -3
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
'en-US':
|
|
29
29
|
'Data consists of indicators and dimensions. Dimension refers to data attributes, and indicator refers to quantitative measurement standards.'
|
|
30
30
|
},
|
|
31
|
-
'demoId': 'chart
|
|
31
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
'name': 'settings ',
|
|
@@ -45,42 +45,42 @@ export default {
|
|
|
45
45
|
'type': 'String',
|
|
46
46
|
'defaultValue': '该属性的默认值为 auto',
|
|
47
47
|
'desc': { 'zh-CN': '设置图表容器的宽度。', 'en-US': 'Set the width of the chart container.' },
|
|
48
|
-
'demoId': 'chart
|
|
48
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
'name': 'height',
|
|
52
52
|
'type': 'String',
|
|
53
53
|
'defaultValue': '该属性的默认值为 400px',
|
|
54
54
|
'desc': { 'zh-CN': '设置图表容器的高度。', 'en-US': 'Set the height of the chart container.' },
|
|
55
|
-
'demoId': 'chart
|
|
55
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
'name': 'events',
|
|
59
59
|
'type': 'Object',
|
|
60
60
|
'defaultValue': '',
|
|
61
61
|
'desc': { 'zh-CN': '事件绑定', 'en-US': 'Event binding' },
|
|
62
|
-
'demoId': 'chart
|
|
62
|
+
'demoId': 'chart-events#events-base'
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
'name': 'init-options',
|
|
66
66
|
'type': 'Object',
|
|
67
67
|
'defaultValue': '',
|
|
68
68
|
'desc': { 'zh-CN': 'init 附加参数', 'en-US': 'Init Additional Parameters' },
|
|
69
|
-
'demoId': 'chart
|
|
69
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
'name': 'tooltip-visible',
|
|
73
73
|
'type': 'Boolean',
|
|
74
74
|
'defaultValue': '该属性的默认值为 true',
|
|
75
75
|
'desc': { 'zh-CN': '是否显示提示框', 'en-US': 'Display dialog box' },
|
|
76
|
-
'demoId': 'chart
|
|
76
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
'name': 'legend-visible',
|
|
80
80
|
'type': 'Boolean',
|
|
81
81
|
'defaultValue': '该属性的默认值为 true',
|
|
82
82
|
'desc': { 'zh-CN': '是否显示图例', 'en-US': 'Display legend' },
|
|
83
|
-
'demoId': 'chart
|
|
83
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
'name': 'theme',
|
|
@@ -110,21 +110,21 @@ export default {
|
|
|
110
110
|
'zh-CN': '是否处理生成图表时的宽度问题',
|
|
111
111
|
'en-US': 'Do you want to process the width issue when generating charts?'
|
|
112
112
|
},
|
|
113
|
-
'demoId': 'chart
|
|
113
|
+
'demoId': 'chart-events#events-base'
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
'name': 'width-change-delay',
|
|
117
117
|
'type': 'Number',
|
|
118
118
|
'defaultValue': '该属性的默认值为 300',
|
|
119
119
|
'desc': { 'zh-CN': '容器宽度变化的延迟', 'en-US': 'Container width change delay' },
|
|
120
|
-
'demoId': 'chart
|
|
120
|
+
'demoId': 'chart-question#question-base'
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
'name': 'resizeable',
|
|
124
124
|
'type': 'Boolean',
|
|
125
125
|
'defaultValue': '该属性的默认值为 true',
|
|
126
126
|
'desc': { 'zh-CN': '是否处理窗口 resize 事件', 'en-US': 'Whether to process the window resize event' },
|
|
127
|
-
'demoId': 'chart
|
|
127
|
+
'demoId': 'chart-question#question-base'
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
'name': 'cancel-resize-check',
|
|
@@ -134,14 +134,14 @@ export default {
|
|
|
134
134
|
'zh-CN': '是否禁用 resize 时的容器检测',
|
|
135
135
|
'en-US': 'Whether to disable container detection during resize'
|
|
136
136
|
},
|
|
137
|
-
'demoId': 'chart
|
|
137
|
+
'demoId': 'chart-question#question-base'
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
'name': 'resize-delay',
|
|
141
141
|
'type': 'Number',
|
|
142
142
|
'defaultValue': '该属性的默认值为 200',
|
|
143
143
|
'desc': { 'zh-CN': '窗口 resize 事件回调的延迟', 'en-US': 'Delay of the window resize event callback' },
|
|
144
|
-
'demoId': 'chart
|
|
144
|
+
'demoId': 'chart-attributes-demo#props-demo10'
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
'name': 'change-delay',
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
151
151
|
'zh-CN': '属性修改触发图表重绘回调的延迟',
|
|
152
152
|
'en-US': 'Delay for triggering chart redrawing callback after attribute modification'
|
|
153
153
|
},
|
|
154
|
-
'demoId': 'chart
|
|
154
|
+
'demoId': 'chart-question#question-base'
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
'name': 'set-option-opts',
|
package/index.html
CHANGED
package/md.extend.config.js
CHANGED
|
@@ -18,35 +18,11 @@ import md_anchor from 'markdown-it-anchor'
|
|
|
18
18
|
|
|
19
19
|
export const MdExt = [md_emoji, md_sub, md_sup, md_mark]
|
|
20
20
|
|
|
21
|
-
// 自定义container
|
|
22
|
-
function createContainer(klass) {
|
|
23
|
-
return [
|
|
24
|
-
md_container,
|
|
25
|
-
klass,
|
|
26
|
-
{
|
|
27
|
-
render(tokens, idx) {
|
|
28
|
-
const token = tokens[idx]
|
|
29
|
-
const info = token.info.trim().slice(klass.length).trim() || ''
|
|
30
|
-
if (token.nesting === 1) {
|
|
31
|
-
return `<div class="${klass} custom-block"><p class="custom-block-title">${info}</p>\n`
|
|
32
|
-
} else {
|
|
33
|
-
return `</div>\n`
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
|
|
40
21
|
export function mdInstall(md) {
|
|
41
|
-
md.use(md_prism, { plugins: ['line-highlight'] })
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
permalink: true,
|
|
48
|
-
permalinkBefore: true,
|
|
49
|
-
permalinkSymbol: '',
|
|
50
|
-
slugify: (s) => encodeURIComponent(s)
|
|
51
|
-
})
|
|
22
|
+
md.use(md_prism, { plugins: ['line-highlight'] }).use(md_anchor, {
|
|
23
|
+
permalink: true,
|
|
24
|
+
permalinkBefore: true,
|
|
25
|
+
permalinkSymbol: '',
|
|
26
|
+
slugify: (s) => encodeURIComponent(s)
|
|
27
|
+
})
|
|
52
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-docs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@unocss/reset": "0.38.2",
|
|
6
6
|
"@vue/repl": "^2.5.5",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"@playwright/test": "^1.29.2",
|
|
17
17
|
"sortablejs": "1.15.0",
|
|
18
18
|
"@opentiny/vue-repl": "^1.0.2",
|
|
19
|
-
"@opentiny/vue": "~3.10.0",
|
|
20
19
|
"@opentiny/vue-common": "~3.10.0",
|
|
21
|
-
"@opentiny/vue
|
|
20
|
+
"@opentiny/vue": "~3.10.0",
|
|
22
21
|
"@opentiny/vue-icon": "~3.10.0",
|
|
23
|
-
"@opentiny/vue-vite-import": "~1.1.5",
|
|
24
|
-
"@opentiny/vue-theme": "~3.10.0",
|
|
25
|
-
"@opentiny/vue-design-smb": "~3.10.0",
|
|
26
22
|
"@opentiny/vue-theme-saas": "~3.10.0",
|
|
27
|
-
"@opentiny/vue-
|
|
23
|
+
"@opentiny/vue-design-aurora": "~3.10.0",
|
|
24
|
+
"@opentiny/vue-design-smb": "~3.10.0",
|
|
25
|
+
"@opentiny/vue-theme": "~3.10.0",
|
|
26
|
+
"@opentiny/vue-theme-mobile": "~3.10.0",
|
|
27
|
+
"@opentiny/vue-vite-import": "~1.1.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/markdown-it": "^12.2.3",
|
package/playground/App.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { reactive, ref } from 'vue'
|
|
2
|
+
import { onMounted, reactive, ref } from 'vue'
|
|
3
3
|
import { Repl, useStore, File } from '@opentiny/vue-repl'
|
|
4
4
|
import '@opentiny/vue-repl/dist/style.css'
|
|
5
5
|
import Monaco from '@vue/repl/monaco-editor'
|
|
@@ -22,7 +22,8 @@ const createImportMap = (version) => {
|
|
|
22
22
|
'@opentiny/vue': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue.mjs`,
|
|
23
23
|
'@opentiny/vue-icon': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-icon.mjs`,
|
|
24
24
|
'@opentiny/vue-locale': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-locale.mjs`,
|
|
25
|
-
'@opentiny/vue-common': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-common.mjs
|
|
25
|
+
'@opentiny/vue-common': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-common.mjs`,
|
|
26
|
+
'sortablejs': `${cdnHost}/sortablejs@1.15.0/modular/sortable.esm.js`
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -63,19 +64,18 @@ const state = reactive({
|
|
|
63
64
|
|
|
64
65
|
function versionChange(version) {
|
|
65
66
|
const importMap = createImportMap(version)
|
|
66
|
-
store.
|
|
67
|
+
store.state.files['import-map.json'] = new File('', JSON.stringify(importMap))
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
if (!document.querySelector('iframe')) return
|
|
71
|
+
|
|
72
|
+
const iframeWin = document.querySelector('iframe').contentWindow
|
|
73
73
|
const link = iframeWin.document.createElement('link')
|
|
74
74
|
link.id = 'tiny-theme'
|
|
75
75
|
link.rel = 'stylesheet'
|
|
76
76
|
link.href = `${cdnHost}/@opentiny/vue-theme@${version}/index.css`
|
|
77
77
|
iframeWin.document.head.append(link)
|
|
78
|
-
}
|
|
78
|
+
}, 300)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function getDemoName(name, apiMode) {
|
|
@@ -89,7 +89,7 @@ const getDemoCode = async ({ cmpId, fileName, apiMode }) => {
|
|
|
89
89
|
.then((code) => {
|
|
90
90
|
return code
|
|
91
91
|
})
|
|
92
|
-
.catch((
|
|
92
|
+
.catch(() => {
|
|
93
93
|
return `${demoName}示例资源不存在,请检查文件名是否正确?`
|
|
94
94
|
})
|
|
95
95
|
|
|
@@ -104,23 +104,25 @@ const loadFileCode = async ({ cmpId, fileName, apiMode }) => {
|
|
|
104
104
|
versionChange(latestVersion)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
onMounted(() => {
|
|
108
|
+
// 初始加载,有分享则加载分享,否则加载默认版本的默认文件
|
|
109
|
+
if (shareData.length === 2) {
|
|
110
|
+
versionChange(shareData[0])
|
|
111
|
+
} else {
|
|
112
|
+
const searchObj = new URLSearchParams(location.search)
|
|
113
|
+
const fileName = searchObj.get('fileName')
|
|
114
|
+
const cmpId = searchObj.get('cmpId')
|
|
115
|
+
const apiMode = searchObj.get('apiMode')
|
|
116
|
+
if (fileName && cmpId && apiMode) {
|
|
117
|
+
loadFileCode({ cmpId, fileName, apiMode })
|
|
118
|
+
}
|
|
117
119
|
}
|
|
118
|
-
}
|
|
120
|
+
})
|
|
119
121
|
|
|
120
122
|
// 分享功能
|
|
121
123
|
function share() {
|
|
122
|
-
const hash = store.serialize()
|
|
123
|
-
const shareUrl = location.origin + '/tiny-vue/playground
|
|
124
|
+
const hash = store.serialize()
|
|
125
|
+
const shareUrl = location.origin + '/tiny-vue/playground#' + state.selectVersion + '|' + hash
|
|
124
126
|
|
|
125
127
|
navigator.clipboard.writeText(shareUrl)
|
|
126
128
|
Notify({
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<tbody>
|
|
60
60
|
<tr v-for="row in oneApiArr" :key="row.name">
|
|
61
61
|
<td>
|
|
62
|
-
<a v-if="row.demoId"
|
|
62
|
+
<a v-if="row.demoId" @click="jumpToDemo(row.demoId)">{{ row.name }}</a>
|
|
63
63
|
<span v-else>{{ row.name }}</span>
|
|
64
64
|
</td>
|
|
65
65
|
<td v-if="!key.includes('slots')"><span class="route-anchor" v-html="row.type"></span></td>
|
|
@@ -254,6 +254,13 @@ const handleApiAnchor = (ev) => {
|
|
|
254
254
|
const fn = {
|
|
255
255
|
copyText: (text) => {
|
|
256
256
|
navigator.clipboard.writeText(text)
|
|
257
|
+
},
|
|
258
|
+
jumpToDemo: (demoId) => {
|
|
259
|
+
if (demoId.startsWith('chart') || demoId.startsWith('grid')) {
|
|
260
|
+
router.push(demoId)
|
|
261
|
+
} else {
|
|
262
|
+
router.push(`#${demoId}`)
|
|
263
|
+
}
|
|
257
264
|
}
|
|
258
265
|
}
|
|
259
266
|
|