angularjs - 在与项目相关的投票投票期间,我在用 vscode 编写时收到输入太少的参数错误
问题描述
代码如下:
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Component, Input, OnInit } from '@angular/core';
import ApexCharts from "apexcharts";
@Component({
selector: 'app-poll-vote',
templateUrl: './poll-vote.component.html',
styleUrls: ['./poll-vote.component.scss']
})
export class PollVoteComponent implements OnInit {
@Input() voted: boolean;
@Input() options: string[];
@Input() results: number[];
@Input() question: string;
voteForm: FormGroup;
constructor(private fb: FormBuilder) {
this.voteForm = this.fb.group({
selected : this.fb.control("",[Validators.required]),
})
}
ngOnInit(): void {
if(this.voted){
this.generateChart()
}
}
submitForm(){
console.log(this.voteForm.value);
}
generateChart(){
const options: ApexCharts.ApexOptions = {
series : [
{
data : this.results,
},
],
chart : {
height : 350,
type : 'bar',
},
plotOptions :{
bar : {
columnWidth :'45%',
distributed : true,
},
},
legend:{
show: false,
},
xaxis :{
categories : this.options,
},
};
const chart = new ApexCharts(document.getElementById('poll-results'),options);
chart.render()
}
}
输出错误如下图: [1]: https://i.stack.imgur.com/btuTP.png
有谁知道如何解决这个问题?
解决方案
推荐阅读
- jenkins - Jenkins 不会通过 sh 'cd directory' 命令更改目录
- localization - 如何在代码中更改 Apple Watch 的应用语言?
- reactjs - 尝试在reactjs中使用firebase auth保持用户登录
- python - 从句子中查找并删除一个单词(在单词匹配之间)python
- android - 带有变音符号的 Gradle.properties
- vue.js - 第一次拖动不适用于 vue-smooth-dnd vuejs
- regex - 特定电子邮件地址验证 - .NET Core MVC 模型
- vba - MS Access 数据宏 - 在同一个表中插入后
- python - 根据字典 d1 中的标准键在两个字典中查找元素应该是 d2 中的值,反之亦然
- php - 根据类别添加自定义内容到帖子