组件-Element—Transfer(穿梭框)
组件—穿梭框
-
基础用法
<template> <el-transfer v-model="value" :data="data"></el-transfer> </template> <script> export default { data() { const generateData = _ => { const data = []; for (let i = 1; i <= 15; i++) { data.push({ key: i, label: `备选项 ${ i }`, disabled: i % 4 === 0 }); } return data; }; return { data: generateData(), value: [1, 4] }; } }; </script>
-
可搜索
<template> <el-transfer filterable :filter-method="filterMethod" filter-placeholder="请输入城市拼音" v-model="value" :data="data"> </el-transfer> </template> <script> export default { data() { const generateData = _ => { const data = []; const cities = ['上海', '北京', '广州&