0

我正在尝试修改数组中对象内的字体大小和字体类型。它在一个 DOM 中。我在字体系列和字体大小上的线条似乎不起作用。你能帮忙看看正确的语法吗?


const ironCurtainQuiz = [
  {
    question: "The camera footage has arrived back at base. The number one priority is to show it to:",
    options: ["The president.", "The Pentagon.", "The CIA."],
    answer: 0,
    background: "./../images/image-question-1.jpg",
    fontSize: "28px",
    fontFamily: "Courier, Courier New, Serif",
  },
]

4

1 回答 1

0

这里更新对象值数组的简单方法谢谢:-)

const ironCurtainQuiz = [
  {
    question: "The camera footage has arrived back at base. The number one priority is to show it to:",
    options: ["The president.", "The Pentagon.", "The CIA."],
    answer: 0,
    background: "./../images/image-question-1.jpg",
    fontSize: "28px",
    fontFamily: "Courier, Courier New, Serif",
  },
]

ironCurtainQuiz[0].fontSize = '58px'
ironCurtainQuiz[0].fontFamily = 'ROBOTO'

console.log(ironCurtainQuiz)

于 2020-04-08T08:40:37.723 回答