Browse Source

活动页面bug

Administrator 8 months ago
parent
commit
694aa39038
1 changed files with 4 additions and 7 deletions
  1. 4 7
      src/views/activity/rule/index.vue

+ 4 - 7
src/views/activity/rule/index.vue

@@ -236,10 +236,7 @@ const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
 
 const data = ref([])
 const templateData = ref([])
-const templateOptionData = ref([{
-  "value":"number",
-  "label":"string"
-}])
+const templateOptionData = reactive([])
 let currPageNum = 1;
 const pageSize = 1000;
 onBeforeMount(() => {
@@ -250,9 +247,9 @@ onBeforeMount(() => {
 const loadActivityTemplateInfo = () => {
   activityTemplateApi.all().then(res => {
     templateData.value = res.data.result;
-    for (var i=0; i < templateData.value.length; i++) {
-      templateOptionData.value[i].value = templateData.value[i].id
-      templateOptionData.value[i].label = templateData.value[i].id +"-"+templateData.value[i].name
+    for (var i = 0; i < templateData.value.length; i++) {
+      let val = {"value" : templateData.value[i].id, "label" : templateData.value[i].id + "-" + templateData.value[i].name}
+      templateOptionData.push(val)
     }
     console.log(templateData)
     console.log(templateOptionData)