平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 2.5 KiB

2 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="content">
  3. <view class="hader">基础用法</view>
  4. <jp-select-plus label="单选不带搜索" placeholder="请选择" v-model="va1" :list="listc"></jp-select-plus>
  5. <jp-select-plus label="单选带搜索设置主题色" color="#f00"placeholder="请选择" isSearch v-model="va1" :list="listc"></jp-select-plus>
  6. <jp-select-plus label="多选带搜索-排列展示结果" placeholder="请选择" checkbox isSearch v-model="va2" :list="listc"></jp-select-plus>
  7. <jp-select-plus label="多选带搜索-拼接展示结果" placeholder="请选择" isJoin checkbox isSearch v-model="va2" :list="listc"></jp-select-plus>
  8. <jp-select-plus label="一行选择框" :isLineFeed="false" placeholder="请选择" isSearch v-model="va1" :list="listc"></jp-select-plus>
  9. <jp-select-plus label="改变选择主题颜色" placeholder="请选择" isSearch v-model="va1" :list="listc"></jp-select-plus>
  10. <view class="hader">进阶用法</view>
  11. <jp-select-plus @onOpen="getList()" @onSearch="getList()" label="点击后才去后端拿数据,展示加载中" isSearchFun isLoading placeholder="请选择" isSearch v-model="va1" :list="list2"></jp-select-plus>
  12. <view class="hader">只使用弹框</view>
  13. <view class="but" @click="toOpen">
  14. 点击开启弹框选择数据
  15. </view>
  16. 选中的数据:{{va3}}
  17. <jp-select-plus ref="selectPlus" :isShow="false" v-model="va3" :list="listc"></jp-select-plus>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. va1: '',
  25. va2: [],
  26. va3: '',
  27. listc: [{
  28. code: 'CHN',
  29. name: '中国'
  30. }, {
  31. name: '美国5',
  32. code: 'USA'
  33. }, {
  34. name: '巴西',
  35. code: 'BRA'
  36. }, {
  37. name: '日本',
  38. code: 'JPN'
  39. }, {
  40. name: '英国',
  41. code: 'ENG'
  42. }, {
  43. name: '法国',
  44. code: 'FRA'
  45. }, {
  46. name: '小人国',
  47. code: 'xr1'
  48. }, {
  49. name: '大人国',
  50. code: 'xr2'
  51. }, {
  52. name: '中人国中人国中人国中人国中人国中人国中人国中人国中人国中人国中人国',
  53. code: 'xr3'
  54. }],
  55. list2:[]
  56. }
  57. },
  58. methods: {
  59. toOpen(){
  60. this.$refs.selectPlus.open()
  61. },
  62. getList(){
  63. let that = this
  64. setTimeout(()=>{
  65. that.list2 = that.listc
  66. },2000)
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .content {
  73. padding: 0 20px;
  74. .but{
  75. margin: 10rpx 25rpx;
  76. background-color: #00aaff;
  77. color: #fff;
  78. text-align: center;
  79. line-height: 80rpx;
  80. }
  81. .hader {
  82. line-height: 80rpx;
  83. font-weight: 800;
  84. }
  85. }
  86. </style>