forked from element-plus/element-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ssr): add ssr testing cases (element-plus#6647)
- Loading branch information
Showing
7 changed files
with
121 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ const scopes = [ | |
'color', | ||
'border', | ||
'var', | ||
'ssr', | ||
] | ||
|
||
module.exports = { | ||
|
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,5 @@ | ||
<template> | ||
<el-affix :offset="120"> | ||
<el-button type="primary">Offset top 120px</el-button> | ||
</el-affix> | ||
</template> |
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,6 @@ | ||
<template> | ||
<el-alert title="success alert" type="success" style="margin-bottom: 20px" /> | ||
<el-alert title="info alert" type="info" style="margin-bottom: 20px" /> | ||
<el-alert title="warning alert" type="warning" style="margin-bottom: 20px" /> | ||
<el-alert title="error alert" type="error" style="margin-bottom: 20px" /> | ||
</template> |
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,61 @@ | ||
<template> | ||
<el-row class="demo-autocomplete text-center"> | ||
<el-col :span="12"> | ||
<div class="sub-title my-2 text-sm text-gray-600"> | ||
list suggestions when activated | ||
</div> | ||
<el-autocomplete | ||
v-model="state1" | ||
:fetch-suggestions="querySearch" | ||
class="inline-input" | ||
placeholder="Please Input" | ||
@select="handleSelect" | ||
/> | ||
</el-col> | ||
<el-col :span="12"> | ||
<div class="sub-title my-2 text-sm text-gray-600"> | ||
list suggestions on input | ||
</div> | ||
<el-autocomplete | ||
v-model="state2" | ||
:fetch-suggestions="querySearch" | ||
:trigger-on-focus="false" | ||
class="inline-input" | ||
placeholder="Please Input" | ||
@select="handleSelect" | ||
/> | ||
</el-col> | ||
</el-row> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
interface RestaurantItem { | ||
value: string | ||
link: string | ||
} | ||
const state1 = ref('') | ||
const state2 = ref('') | ||
const restaurants = ref<RestaurantItem[]>([]) | ||
const querySearch = (queryString: string, cb: any) => { | ||
const results = queryString | ||
? restaurants.value.filter(createFilter(queryString)) | ||
: restaurants.value | ||
// call callback function to return suggestions | ||
cb(results) | ||
} | ||
const createFilter = (queryString: string) => { | ||
return (restaurant: RestaurantItem) => { | ||
return ( | ||
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0 | ||
) | ||
} | ||
} | ||
const handleSelect = () => { | ||
// | ||
} | ||
</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,33 @@ | ||
<template> | ||
<div class="demo-type"> | ||
<div> | ||
<el-avatar :icon="UserFilled" /> | ||
</div> | ||
<div> | ||
<el-avatar | ||
src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" | ||
/> | ||
</div> | ||
<div> | ||
<el-avatar> user </el-avatar> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { UserFilled } from '@element-plus/icons-vue' | ||
</script> | ||
|
||
<style scoped> | ||
.demo-type { | ||
display: flex; | ||
} | ||
.demo-type > div { | ||
flex: 1; | ||
text-align: center; | ||
} | ||
.demo-type > div:not(:last-child) { | ||
border-right: 1px solid var(--el-border-color); | ||
} | ||
</style> |
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