@opentiny/vue-docs 3.18.0 → 3.18.2
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/pc/app/link/basic-usage-composition-api.vue +5 -1
- package/demos/pc/app/link/basic-usage.spec.ts +11 -0
- package/demos/pc/app/link/basic-usage.vue +6 -1
- package/demos/pc/app/link/webdoc/link.js +8 -2
- package/package.json +7 -7
- package/src/main.js +2 -2
- package/src/views/components/float-settings.vue +16 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<tiny-link>默认链接</tiny-link>
|
|
3
|
+
<tiny-link @click="handleClick">默认链接</tiny-link>
|
|
4
4
|
<tiny-link value="默认链接2"></tiny-link>
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script setup>
|
|
9
9
|
import { Link as TinyLink } from '@opentiny/vue'
|
|
10
|
+
|
|
11
|
+
function handleClick() {
|
|
12
|
+
console.log('clicked')
|
|
13
|
+
}
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
<style scoped>
|
|
@@ -10,4 +10,15 @@ test('基础用法', async ({ page }) => {
|
|
|
10
10
|
await expect(link.nth(1)).toHaveText('默认链接2')
|
|
11
11
|
await link.first().hover()
|
|
12
12
|
await expect(link.first()).toHaveCSS('color', 'rgb(82, 110, 204)')
|
|
13
|
+
|
|
14
|
+
// 测试点击
|
|
15
|
+
const values = [] as string[]
|
|
16
|
+
page.on('console', async (msg) => {
|
|
17
|
+
for (const arg of msg.args()) {
|
|
18
|
+
values.push(await arg.jsonValue())
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
await link.first().click()
|
|
22
|
+
|
|
23
|
+
expect(values[0]).toBe('clicked')
|
|
13
24
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<tiny-link>默认链接</tiny-link>
|
|
3
|
+
<tiny-link @click="handleClick">默认链接</tiny-link>
|
|
4
4
|
<tiny-link value="默认链接2"></tiny-link>
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
@@ -11,6 +11,11 @@ import { Link } from '@opentiny/vue'
|
|
|
11
11
|
export default {
|
|
12
12
|
components: {
|
|
13
13
|
TinyLink: Link
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
handleClick() {
|
|
17
|
+
console.log('clicked')
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
</script>
|
|
@@ -9,8 +9,14 @@ export default {
|
|
|
9
9
|
'en-US': 'Basic Usage'
|
|
10
10
|
},
|
|
11
11
|
desc: {
|
|
12
|
-
'zh-CN':
|
|
13
|
-
|
|
12
|
+
'zh-CN': `
|
|
13
|
+
通过 <code>value</code> 或者默认插槽设置链接显示内容。<br>
|
|
14
|
+
绑定 <code>click</code> 事件监听点击。 当禁用或配置 <code>href</code> 属性时, 不会触发<code>click</code>事件!
|
|
15
|
+
`,
|
|
16
|
+
'en-US': `
|
|
17
|
+
Set the link to display content via <code>value</code> or the default slot.
|
|
18
|
+
Bind the click event to listen for clicks.The click event is not triggered when the href attribute is disabled or configured!
|
|
19
|
+
`
|
|
14
20
|
},
|
|
15
21
|
codeFiles: ['basic-usage.vue']
|
|
16
22
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-docs",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@opentiny/vue-repl": "^1.1.2",
|
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
"vue": "^3.4.31",
|
|
17
17
|
"vue-i18n": "^9.1.10",
|
|
18
18
|
"vue-router": "4.1.5",
|
|
19
|
+
"@opentiny/vue-design-smb": "~3.18.0",
|
|
20
|
+
"@opentiny/vue-design-saas": "~3.18.0",
|
|
19
21
|
"@opentiny/vue-common": "~3.18.0",
|
|
20
|
-
"@opentiny/vue-directive": "~3.18.0",
|
|
21
22
|
"@opentiny/vue-design-aurora": "~3.18.0",
|
|
23
|
+
"@opentiny/vue-directive": "~3.18.0",
|
|
22
24
|
"@opentiny/vue": "~3.18.0",
|
|
23
25
|
"@opentiny/vue-icon": "~3.18.0",
|
|
24
|
-
"@opentiny/vue-design-smb": "~3.18.0",
|
|
25
|
-
"@opentiny/vue-theme": "~3.18.0",
|
|
26
26
|
"@opentiny/vue-icon-saas": "~3.18.0",
|
|
27
|
-
"@opentiny/vue-
|
|
28
|
-
"@opentiny/vue-
|
|
27
|
+
"@opentiny/vue-theme": "~3.18.0",
|
|
28
|
+
"@opentiny/vue-theme-mobile": "~3.18.0",
|
|
29
29
|
"@opentiny/vue-theme-saas": "~3.18.0",
|
|
30
|
-
"@opentiny/vue-
|
|
30
|
+
"@opentiny/vue-vite-import": "~1.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@playwright/test": "~1.42.0",
|
package/src/main.js
CHANGED
|
@@ -9,8 +9,8 @@ import 'uno.css'
|
|
|
9
9
|
// highlight默认样式
|
|
10
10
|
import 'highlight.js/styles/default.css'
|
|
11
11
|
|
|
12
|
-
// markdown
|
|
13
|
-
import 'github-markdown-css/github-markdown.css'
|
|
12
|
+
// 只使用markdown的亮色主题
|
|
13
|
+
import 'github-markdown-css/github-markdown-light.css'
|
|
14
14
|
import './assets/index.less'
|
|
15
15
|
import './style.css'
|
|
16
16
|
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
|
|
89
89
|
<script>
|
|
90
90
|
import { defineComponent, reactive, toRefs, onMounted, onUnmounted, watch, nextTick, ref } from 'vue'
|
|
91
|
-
import { Tooltip, Radio, RadioGroup, Popover } from '@opentiny/vue'
|
|
91
|
+
import { Tooltip, Radio, RadioGroup, Popover, Notify } from '@opentiny/vue'
|
|
92
92
|
import { iconUpWard } from '@opentiny/vue-icon'
|
|
93
93
|
import debounce from '@opentiny/vue-renderless/common/deps/debounce'
|
|
94
94
|
import { i18nByKey, useApiMode, useTemplateMode } from '@/tools'
|
|
@@ -129,6 +129,17 @@ export default defineComponent({
|
|
|
129
129
|
initBottomVal: null, // 初始底部偏移
|
|
130
130
|
isSettingsAside: false // 是否贴边
|
|
131
131
|
})
|
|
132
|
+
let isShowTip = false
|
|
133
|
+
const showTip = () => {
|
|
134
|
+
Notify({
|
|
135
|
+
type: 'info',
|
|
136
|
+
title: '请注意',
|
|
137
|
+
message: '主题切换成功,如有部分主题样式不生效,请尝试手动刷新页面即可',
|
|
138
|
+
position: 'top-right',
|
|
139
|
+
duration: 3000
|
|
140
|
+
})
|
|
141
|
+
isShowTip = true
|
|
142
|
+
}
|
|
132
143
|
|
|
133
144
|
if (isPlus) {
|
|
134
145
|
state.styleSettings = state.styleSettings.filter((item) => item.name !== 'apiMode')
|
|
@@ -164,6 +175,10 @@ export default defineComponent({
|
|
|
164
175
|
themeItemClick(node) {
|
|
165
176
|
const val = node?.value || 'tiny-smb-theme'
|
|
166
177
|
changeTheme(val)
|
|
178
|
+
|
|
179
|
+
if (!isShowTip) {
|
|
180
|
+
showTip()
|
|
181
|
+
}
|
|
167
182
|
}
|
|
168
183
|
}
|
|
169
184
|
|