<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><title>Document</title><style>.div{
font-style: normal;}</style></head><body><scripttype="module">import Star from"./js/Star.js";//引入五星好评的组件let list =["饭菜质量","商家服务","外卖速度速度","骑手态度"];//需要评价的内容for(var i=0;i<list.length;i++){
let star =newStar(list[i],12);//创建星星,后面的12是 用cookie时传入的date
star.appendTo("body");//星星添加到body
star.addEventListener("change",(e)=>{
console.log(e.starList);//接受点击的抛发事件,输出当前点击的评价内容和分数组成});}</script></body></html>