1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <modal v-model="vValue">
- <view class="screen_all center" @click="closeModal">
- <view class="select-modal" @click.stop>
- <view class="select-modal-item row aCenter"
- v-for="(item,index) in data"
- :key="index"
- @click="triggerSelect(index)"
- >
- <view class="flex-all-1">
- <view class="line-1">{{item.label}}</view>
- </view>
- <v-radio disabled :value="select===index" color="#fff" borderColor="#7A7A7A" activeBorderColor="#41AE3C" activeColor="#41AE3C"></v-radio>
- </view>
- </view>
- </view>
- </modal>
- </template>
- <script>
- import modal from '@/components/modal/main';
- import vRadio from '@/components/v-radio/main';
- import props from './props';
- export default {
- data(){
- return {
- vValue:false
- }
- },
- watch:{
- value(){
- this.changeValue(this.value);
- }
- },
- methods:{
- changeValue(value){
- if (this.vValue !== value) {
- this.vValue = value;
- if (this.value !== value) {
- return this.$emit('input',value);
- }
- }
- },
- closeModal(){
- if (this.vValue) {
- return this.changeValue(false);
- }
- },
- triggerSelect(index){
- this.closeModal();
- if (this.select !== index) {
- return this.$emit('change',{
- index,
- item: this.data[index]
- })
- }
- }
- },
- props,
- components:{
- modal,
- vRadio
- }
- }
- </script>
- <style scoped src="./style.scss" lang="scss">
- </style>
|