-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(bulletin-board): [bulletin-board] Add click events * feat(bulletin-board): [bulletin-board] Add click events * feat(bulletin-board): [bulletin-board] Add click events
- Loading branch information
1 parent
ac4e4cf
commit 070997f
Showing
9 changed files
with
271 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
examples/sites/demos/pc/app/bulletin-board/events-composition-api.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<template> | ||
<tiny-bulletin-board :tab-title="tabTitle" :data="data" @contentClick="contentClick"></tiny-bulletin-board> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
import { TinyBulletinBoard, TinyModal } from '@opentiny/vue' | ||
const tabTitle = ref(['TINY 更新日志', '他们都在用', 'TINY 特性']) | ||
const data = ref([ | ||
[ | ||
{ | ||
text: 'TINY v2.1.4 版本', | ||
date: '2019-07-31', | ||
url: 'localhost:3000/#/webcore/zh-CN/guide/changelog' | ||
}, | ||
{ | ||
text: 'TINY v2.1.3 版本', | ||
date: '2019-06-11', | ||
url: 'localhost:3000/#/webcore/zh-CN/guide/changelog' | ||
}, | ||
{ | ||
text: 'TINY v2.1.2 版本', | ||
date: '2019-05-11', | ||
url: 'localhost:3000/#/webcore/zh-CN/guide/changelog', | ||
target: '_blank' | ||
} | ||
], | ||
[ | ||
{ | ||
text: 'SRM 采购云', | ||
date: '2018-09-11', | ||
url: 'http://abcdf.com', | ||
target: '_blank' | ||
}, | ||
{ | ||
text: 'iSales', | ||
url: 'http://abcdf.com', | ||
date: '2018-09-11', | ||
route: 'Alert' | ||
}, | ||
{ | ||
text: '数易平台', | ||
url: 'http://abcdf.com', | ||
date: '2018-09-11' | ||
}, | ||
{ | ||
text: 'MES+ 制造平台', | ||
date: '2018-09-11', | ||
url: 'http://abcdf.com', | ||
target: '_blank' | ||
}, | ||
{ | ||
text: 'ISDP', | ||
date: '2018-09-11', | ||
url: 'http://abcdf.com', | ||
route: 'Alert' | ||
}, | ||
{ | ||
text: '财经智慧助手', | ||
url: 'http://abcdf.com', | ||
date: '2018-09-11' | ||
} | ||
], | ||
[ | ||
{ | ||
text: '秒级系统体验,按需打包;一致 UX 体验规范', | ||
date: '2018-09-11', | ||
url: '', | ||
target: '_blank' | ||
}, | ||
{ | ||
text: '内置公共 API 并支持扩展;组件、主题均可扩展', | ||
date: '2018-09-11', | ||
url: '' | ||
}, | ||
{ | ||
text: '丰富教程案例、FAQ、开源组件快速引入', | ||
date: '2018-09-11', | ||
url: '' | ||
}, | ||
{ | ||
text: '内置 80+ web 组件拿来即用;内置 mock, UI 组件库与后端服务自由组合', | ||
url: '', | ||
date: '2018-09-11' | ||
} | ||
] | ||
]) | ||
function contentClick(item) { | ||
TinyModal.message({ | ||
message: '触发 contentClick 事件:内容为' + item.text, | ||
status: 'info' | ||
}) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test('测试点击事件', async ({ page }) => { | ||
page.on('pageerror', (exception) => expect(exception).toBeNull()) | ||
await page.goto('bulletin-board#events') | ||
const demo = page.locator('#events') | ||
const modal = page.locator('.tiny-modal') | ||
|
||
await demo.getByRole('link', { name: 'TINY v2.1.3 版本' }).click() | ||
await expect(modal.getByText('click 事件:内容为TINY v2.1.3 版本')).toBeVisible() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<template> | ||
<tiny-bulletin-board :tab-title="tabTitle" :data="data" @contentClick="contentClick"></tiny-bulletin-board> | ||
</template> | ||
|
||
<script> | ||
import { TinyBulletinBoard, TinyModal } from '@opentiny/vue' | ||
export default { | ||
components: { | ||
TinyBulletinBoard | ||
}, | ||
data() { | ||
return { | ||
tabTitle: ['TINY 更新日志', '他们都在用', 'TINY 特性'], | ||
data: [ | ||
[ | ||
{ | ||
text: 'TINY v2.1.4 版本', | ||
date: '2019-07-31', | ||
url: 'localhost:3000/#/webcore/zh-CN/guide/changelog' | ||
}, | ||
{ | ||
text: 'TINY v2.1.3 版本', | ||
date: '2019-06-11', | ||
url: 'localhost:3000/#/webcore/zh-CN/guide/changelog' | ||
}, | ||
{ | ||
text: 'TINY v2.1.2 版本', | ||
date: '2019-05-11', | ||
url: 'localhost:3000/#/webcore/zh-CN/guide/changelog', | ||
target: '_blank' | ||
} | ||
], | ||
[ | ||
{ | ||
text: 'SRM 采购云', | ||
date: '2018-09-11', | ||
url: 'http://abcdf.com', | ||
target: '_blank' | ||
}, | ||
{ | ||
text: 'iSales', | ||
url: 'http://abcdf.com', | ||
date: '2018-09-11', | ||
route: 'Alert' | ||
}, | ||
{ | ||
text: '数易平台', | ||
url: 'http://abcdf.com', | ||
date: '2018-09-11' | ||
}, | ||
{ | ||
text: 'MES+ 制造平台', | ||
date: '2018-09-11', | ||
url: 'http://abcdf.com', | ||
target: '_blank' | ||
}, | ||
{ | ||
text: 'ISDP', | ||
date: '2018-09-11', | ||
url: 'http://abcdf.com', | ||
route: 'Alert' | ||
}, | ||
{ | ||
text: '财经智慧助手', | ||
url: 'http://abcdf.com', | ||
date: '2018-09-11' | ||
} | ||
], | ||
[ | ||
{ | ||
text: '秒级系统体验,按需打包;一致 UX 体验规范', | ||
date: '2018-09-11', | ||
url: '', | ||
target: '_blank' | ||
}, | ||
{ | ||
text: '内置公共 API 并支持扩展;组件、主题均可扩展', | ||
date: '2018-09-11', | ||
url: '' | ||
}, | ||
{ | ||
text: '丰富教程案例、FAQ、开源组件快速引入', | ||
date: '2018-09-11', | ||
url: '' | ||
}, | ||
{ | ||
text: '内置 80+ web 组件拿来即用;内置 mock, UI 组件库与后端服务自由组合', | ||
url: '', | ||
date: '2018-09-11' | ||
} | ||
] | ||
] | ||
} | ||
}, | ||
methods: { | ||
contentClick(item) { | ||
TinyModal.message({ | ||
message: '触发 contentClick 事件:内容为' + item.text, | ||
status: 'info' | ||
}) | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters