You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< script setup >
/**
* name:
* user: sa0ChunLuyu
* date: 2024年9月11日 19:24:50
*/
import {
ref ,
onMounted
} from 'vue'
import {
$api ,
$response
} from '@/api'
import {
useStore
} from '@/store'
import InputComponent from './input.vue'
import SelectComponent from './select.vue'
const $emit = defineEmits ( [ 'setValue' ] )
const $store = useStore ( )
const $props = defineProps ( {
info : {
type : Object ,
default : ( ) => {
return {
id : 0
}
}
} ,
index : {
type : String ,
default : ''
}
} ) ;
const mountedAction = ( ) => {
}
const setValue = ( index , value ) => {
$emit ( 'setValue' , index , value )
}
onMounted ( ( ) => {
mountedAction ( )
} )
< / script >
< template >
< view >
< view : class = "[
$props.index.includes('-') ? '' : 'question_block_wrapper'
]" >
< view class = "question_title_wrapper" >
< text class = "must_dot_wrapper" > * < / text >
< text class = "question_index_wrapper" > { { $props . index } } . < / text >
< text class = "question_question_wrapper" > { { $props . info [ 'question' ] } } < / text >
< / view >
< view v-if ="$props.info.type === 'input'">
<InputComponent @setValue="setValue" :index="$props.index" :info="$props.info"></InputComponent>
</view>
<view v-else-if="$props.info.type === 'select'">
<SelectComponent @setValue="setValue" :index="$props.index" :info="$props.info" > < / SelectComponent >
< / view >
< / view >
< / view >
< / template >
< style scoped >
. question _question _wrapper {
margin - left : 10 rpx ;
}
. question _index _wrapper {
margin - left : 5 rpx ;
}
. must _dot _wrapper {
color : # DB2C0F ;
}
. question _title _wrapper {
display : flex ;
align - items : center ;
font - weight : 500 ;
font - size : 28 rpx ;
}
. question _block _wrapper {
width : calc ( 100 % - 80 rpx ) ;
margin : 16 rpx auto 0 ;
padding - top : 40 rpx ;
}
< / style >