TODO#129877 嚴選配對-所在地區元件 (vue-scroll-picker)
| | |
| | | scroll-behavior: smooth; |
| | | } |
| | | |
| | | h5 { |
| | | margin: 0; |
| | | } |
| | | |
| | | // btn |
| | | .btn { |
| | | padding: 10px 20px; |
| | |
| | | border-bottom: solid 3px $PRIMARY_BLACK; |
| | | |
| | | } |
| | | } |
| | | |
| | | .vue-scroll-picker { |
| | | height: 250px; |
| | | |
| | | .vue-scroll-picker-list-rotator { |
| | | .vue-scroll-picker-item { |
| | | font-size: 20px; |
| | | padding: 5px 0; |
| | | } |
| | | } |
| | | |
| | | .vue-scroll-picker-layer { |
| | | .top { |
| | | height: calc(50% - 1.2em); |
| | | } |
| | | .bottom { |
| | | height: calc(50% - 1.2em); |
| | | } |
| | | } |
| | | |
| | | } |
¤ñ¹ï·sÀÉ®× |
| | |
| | | <template> |
| | | <div class="text--center"> |
| | | <div class="subTitle mb-10">æå¨å°å</div> |
| | | <el-input |
| | | type="text" |
| | | class="p mt-10" |
| | | v-model="keyWord" |
| | | @change="searchDistrict" |
| | | placeholder="è«è¼¸å
¥ééµå" |
| | | ></el-input> |
| | | <Ui-ScrollPicker |
| | | :options="filterOptions" |
| | | :initValue="district" |
| | | @change="change" |
| | | ></Ui-ScrollPicker> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component } from 'nuxt-property-decorator'; |
| | | |
| | | @Component |
| | | export default class AddressPicker extends Vue { |
| | | |
| | | options = ['åºéå¸', 'å°åå¸', 'æ°åå¸', 'æ¡å縣', 'æ°ç«¹å¸', 'æ°ç«¹ç¸£', 'èæ ç¸£', 'å°ä¸å¸', 'å½°å縣', 'åæç¸£', 'é²æç¸£', 'å義å¸', 'å義縣', 'å°åå¸', 'é«éå¸', '屿±ç¸£', 'å°æ±ç¸£', 'è±è®ç¸£', 'å®è縣', 'æ¾æ¹ç¸£', 'éé縣', '飿±ç¸£']; |
| | | keyWord = ''; |
| | | filterOptions: string[] = []; |
| | | district = 'å°åå¸'; |
| | | |
| | | mounted() { |
| | | this.filterOptions = JSON.parse(JSON.stringify(this.options)); |
| | | } |
| | | |
| | | searchDistrict() { |
| | | this.filterOptions = this.options.filter(e => e.match(this.keyWord)); |
| | | } |
| | | |
| | | change(value: string) { |
| | | console.log('change', value) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .cus-input { |
| | | font-size: 20px; |
| | | } |
| | | </style> |
| | |
| | | title="" |
| | | :visible.sync="dialogVisible" |
| | | :width="width" |
| | | @close="close" |
| | | @close="closeDialog" |
| | | > |
| | | <slot></slot> |
| | | </el-dialog> |
| | |
| | | |
| | | @Emit('closeDialog') closeDialog() { |
| | | return; |
| | | } |
| | | |
| | | close() { |
| | | this.closeDialog(); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | :size="size" |
| | | :visible.sync="drawerVisible" |
| | | :direction="'btt'" |
| | | @close="close" |
| | | @close="closeDrawer" |
| | | > |
| | | <div class="close" @click="drawerVisible = false"></div> |
| | | <slot></slot> |
| | |
| | | |
| | | @Emit('closeDrawer') closeDrawer() { |
| | | return; |
| | | } |
| | | |
| | | close() { |
| | | this.closeDrawer(); |
| | | } |
| | | } |
| | | </script> |
¤ñ¹ï·sÀÉ®× |
| | |
| | | <template> |
| | | <Scroll-Picker |
| | | @input="selValue" |
| | | :options="options" |
| | | empty="ç¡ç¯©é¸çµæ" |
| | | :value="initValue" |
| | | ></Scroll-Picker> |
| | | </template> |
| | | |
| | | <script lang='ts'> |
| | | import { Vue, Component, Prop, Emit } from 'nuxt-property-decorator'; |
| | | |
| | | @Component |
| | | export default class UiScrollPicker extends Vue { |
| | | // https://reposhub.com/vuejs/form-input/wan2land-vue-scroll-picker.html |
| | | |
| | | @Prop() options!: string[]; |
| | | @Prop() initValue!: string; |
| | | |
| | | @Emit('change') selValue(value: string) { |
| | | return value |
| | | } |
| | | |
| | | } |
| | | </script> |
| | |
| | | return; |
| | | } |
| | | |
| | | remove() { |
| | | this.removeTag(); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | css: [ |
| | | 'element-ui/lib/theme-chalk/index.css', |
| | | 'swiper/css/swiper.css', |
| | | 'vue-scroll-picker/dist/style.css', |
| | | '~/assets/scss/main.scss', |
| | | ], |
| | | |
| | |
| | | plugins: [ |
| | | '~/plugins/element-ui.js', |
| | | { src: '~/plugins/vue-awesome-swiper.js', mode: 'client' }, |
| | | '~/plugins/service.ts' |
| | | '~/plugins/service.ts', |
| | | '~/plugins/vue-scroll-picker' |
| | | ], |
| | | |
| | | // Auto import components: https://go.nuxtjs.dev/config-components |
| | |
| | | "nuxt": "^2.15.8", |
| | | "nuxt-property-decorator": "^2.9.1", |
| | | "swiper": "^5.4.5", |
| | | "vue-awesome-swiper": "^4.1.1" |
| | | "vue-awesome-swiper": "^4.1.1", |
| | | "vue-scroll-picker": "0.8.0" |
| | | }, |
| | | "devDependencies": { |
| | | "@nuxt/types": "^2.15.8", |
¤ñ¹ï·sÀÉ®× |
| | |
| | | import Vue from "vue" |
| | | import VueScrollPicker from "vue-scroll-picker" |
| | | |
| | | Vue.use(VueScrollPicker) |