echarts出现“There is a chart instance already initialized on The dom.”警告的解决办法
2024-01-29由于项目中二次封装了echarts折线图,并且父组件通过选择不同时间,像后端请求不同数据,显示在折线图上,频繁切换会出现“There is a chart instance already initialized on The dom.”的警告,在网络上找办法后,解决了这个问题。这个问题的出现在于,在一张表上渲染不同数据,其实dom已经存在了,但是我们在每次数据发生改变的时间都重新进行了一次渲染,导致出现警告。// 检测是否已经存在echarts实例,如果不存在,则不再去初始化。_[echarts] There is a chart instance already initialized on The dom.
【HTML5】HTML5 语音合成
2024-01-25前一段时间在项目中需要用到播报文字语音。找到了 HTML 5 有这样的功能。现在有时间进行总结下。SpeechSynThesis 接口是语音服务的控制接口。它可以用于获取设备上关于可用的合成声音的信息,开始、暂停语音,或者别的命令。(MDN)SpeechSynThesis 是 window 上面的属性,可以直接调用。属性:下面的都是只读属性paused:是否处于暂停状态,返回 Boolean 值pending:语音播报队列中是否有需要说的语音,返回 Boolean 值speaking:是否正在进行语音播报(
HTML文档引入JS模块出现路径问题
2024-01-25JS抽离, 引入three模块.LiveServer报错:```Uncaught TypeError: Failed to resolve module specifier "three".Relative references must start with eiTher "/", "./", or "../"._relative references must start with eiTher "/", "./", or "../".
Uncaught SyntaxError: The requested module ‘…/xx/xx/x.js’ does not provide an export named ‘default’
2024-01-24Uncaught SyntaxError: The requested module '/src/store/modules/app.js?t=1695116095181' does not provide an export named 'useAppStore'_does not provide an export named 'default