40 lines
1.1 KiB
Vue
40 lines
1.1 KiB
Vue
<template>
|
||
<div>
|
||
<p>场景1:默认</p>
|
||
<br />
|
||
<tiny-select v-model="value">
|
||
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
|
||
</tiny-select>
|
||
<br /><br />
|
||
<p>场景2:自定义空数据文本</p>
|
||
<br />
|
||
<tiny-select v-model="value" no-data-text="暂无数据">
|
||
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
|
||
</tiny-select>
|
||
<br /><br />
|
||
<p>场景3:显示空数据图片</p>
|
||
<br />
|
||
<tiny-select v-model="value" no-data-text="None" :show-empty-image="true">
|
||
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
|
||
</tiny-select>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref } from 'vue'
|
||
import { Select as TinySelect, Option as TinyOption } from '@opentiny/vue'
|
||
|
||
const options = ref([])
|
||
const value = ref('')
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.tiny-select {
|
||
width: 280px;
|
||
}
|
||
p {
|
||
font-size: 14px;
|
||
line-height: 1.5;
|
||
}
|
||
</style>
|