tiny-vue/examples/sites/demos/pc/app/transfer/before-transfer-composition...

31 lines
692 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<tiny-transfer v-model="value" :data="data" :before-transfer="beforeTransfer"></tiny-transfer>
</template>
<script setup>
import { ref } from 'vue'
import { Transfer as TinyTransfer, Modal } from '@opentiny/vue'
const generateData = () => {
const data = []
for (let i = 0; i <= 15; i++) {
data.push({
key: i,
label: `备选项 ${i}`,
disabled: i % 4 === 0
})
}
return data
}
const data = ref(generateData())
const value = ref([1, 4])
function beforeTransfer(done) {
Modal.message('穿梭功能已被拦截,必须调用 done 方法才能执行穿梭2s后将自动调用 done 方法执行穿梭')
setTimeout(done, 2000)
}
</script>