forked from opentiny/tiny-vue
This commit is contained in:
parent
a2f2cf746a
commit
0e288244c4
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<button @click="closeLoading">close Loading</button>
|
<button @click="closeLoading">close Loading</button>
|
||||||
<div id="tiny-loading1" style="width: 100%; height: 120px"></div>
|
<div id="tiny-basic-loading1" style="width: 100%; height: 120px"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ const loadingInstance = ref(null)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadingInstance.value = Loading.service({
|
loadingInstance.value = Loading.service({
|
||||||
target: document.getElementById('tiny-loading1')
|
target: document.getElementById('tiny-basic-loading1')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'
|
||||||
test('基本用法', async ({ page }) => {
|
test('基本用法', async ({ page }) => {
|
||||||
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
||||||
await page.goto('http://localhost:7130/pc/loading/basic-usage')
|
await page.goto('http://localhost:7130/pc/loading/basic-usage')
|
||||||
const loading = page.locator('#tiny-loading1 > .tiny-loading > .tiny-loading__spinner > .circular')
|
const loading = page.locator('#tiny-basic-loading1 > .tiny-loading > .tiny-loading__spinner > .circular')
|
||||||
await expect(loading).toBeVisible()
|
await expect(loading).toBeVisible()
|
||||||
await page.getByRole('button', { name: 'close Loading' }).click()
|
await page.getByRole('button', { name: 'close Loading' }).click()
|
||||||
await expect(loading).not.toBeVisible()
|
await expect(loading).not.toBeVisible()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<button @click="closeLoading">close Loading</button>
|
<button @click="closeLoading">close Loading</button>
|
||||||
<div id="tiny-loading1" style="width: 100%; height: 120px"></div>
|
<div id="tiny-basic-loading1" style="width: 100%; height: 120px"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadingInstance = Loading.service({
|
this.loadingInstance = Loading.service({
|
||||||
target: document.getElementById('tiny-loading1')
|
target: document.getElementById('tiny-basic-loading1')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div id="tiny-loading1" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
<div id="tiny-size-loading1" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
||||||
<div id="tiny-loading2" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
<div id="tiny-size-loading2" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
||||||
<div id="tiny-loading3" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
<div id="tiny-size-loading3" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -14,15 +14,15 @@ const loadingInstance = ref(null)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadingInstance.value = Loading.service({
|
loadingInstance.value = Loading.service({
|
||||||
target: document.getElementById('tiny-loading1'),
|
target: document.getElementById('tiny-size-loading1'),
|
||||||
size: 'small'
|
size: 'small'
|
||||||
})
|
})
|
||||||
loadingInstance.value = Loading.service({
|
loadingInstance.value = Loading.service({
|
||||||
target: document.getElementById('tiny-loading2'),
|
target: document.getElementById('tiny-size-loading2'),
|
||||||
size: 'medium'
|
size: 'medium'
|
||||||
})
|
})
|
||||||
loadingInstance.value = Loading.service({
|
loadingInstance.value = Loading.service({
|
||||||
target: document.getElementById('tiny-loading3'),
|
target: document.getElementById('tiny-size-loading3'),
|
||||||
size: 'large'
|
size: 'large'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div id="tiny-loading1" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
<div id="tiny-size-loading1" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
||||||
<div id="tiny-loading2" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
<div id="tiny-size-loading2" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
||||||
<div id="tiny-loading3" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
<div id="tiny-size-loading3" style="width: 100%; margin-bottom: 10px; height: 120px"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -17,15 +17,15 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadingInstance = Loading.service({
|
this.loadingInstance = Loading.service({
|
||||||
target: document.getElementById('tiny-loading1'),
|
target: document.getElementById('tiny-size-loading1'),
|
||||||
size: 'small'
|
size: 'small'
|
||||||
})
|
})
|
||||||
this.loadingInstance = Loading.service({
|
this.loadingInstance = Loading.service({
|
||||||
target: document.getElementById('tiny-loading2'),
|
target: document.getElementById('tiny-size-loading2'),
|
||||||
size: 'medium'
|
size: 'medium'
|
||||||
})
|
})
|
||||||
this.loadingInstance = Loading.service({
|
this.loadingInstance = Loading.service({
|
||||||
target: document.getElementById('tiny-loading3'),
|
target: document.getElementById('tiny-size-loading3'),
|
||||||
size: 'large'
|
size: 'large'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue