摘要: 删除 "type": "module", https://github.com/vbenjs/vite-plugin-mock/issues/109#issuecomment-1712430646 阅读全文
posted @ 2024-02-02 11:32 Webwhl 阅读(37) 评论(0) 推荐(0) 编辑
摘要: vite+react项目 // 想法是启东yarn mock时是mock数据,yarn dev连后台。最后想做一个配置文件来改变,这样打包后也可以修改是mock还是后台。 package.json "scripts": { "dev": "vite", "build": "vite build", 阅读全文
posted @ 2024-02-01 15:52 Webwhl 阅读(20) 评论(0) 推荐(0) 编辑
摘要: <div class="container" :style="{'--bgc-color': 'green', '--bgc-border': '10px solid red'}"> </div> .container { margin: 100px; width: 1000px; height: 阅读全文
posted @ 2024-01-16 09:08 Webwhl 阅读(357) 评论(0) 推荐(0) 编辑
摘要: import React, { useEffect, useState, useRef } from "react"; import * as echarts from 'echarts/core' import ReactEchartsCore from 'echarts-for-react/li 阅读全文
posted @ 2023-12-15 14:53 Webwhl 阅读(19) 评论(0) 推荐(0) 编辑
摘要: // 子组件 nav.js import React, { useRef, useEffect, useState, useLayoutEffect } from "react"; import './nav.less' function Nav({items}) { const ref = use 阅读全文
posted @ 2023-10-25 14:18 Webwhl 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 块语句(大括号“{}”中间的语句),如 if 和 switch 条件语句或 for 和 while 循环语句,不像函数,它们不会创建一个新的作用域。在块语句中定义的变量将保留在它们已经存在的作用域中。 if (true) { // 'if' 条件语句块不会创建一个新的作用域 var name = ' 阅读全文
posted @ 2023-10-20 14:16 Webwhl 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 使用函数式更新的方法实现定时器的代码: import React, { useState, useEffect } from 'react'; function App() { const [count, setCount] = useState(0); useEffect(() => { cons 阅读全文
posted @ 2023-10-12 14:58 Webwhl 阅读(276) 评论(0) 推荐(0) 编辑
摘要: const themes = { default: { backgroundColor: 'white', textColor: 'black', fontSize: '16px', }, dark: { backgroundColor: 'black', textColor: 'white', f 阅读全文
posted @ 2023-10-11 15:03 Webwhl 阅读(57) 评论(0) 推荐(0) 编辑
摘要: #方法一: 同端口,不同路径#nginx清空代理末尾加/.#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log 阅读全文
posted @ 2023-10-10 10:57 Webwhl 阅读(296) 评论(0) 推荐(0) 编辑
摘要: const tooltip = (params, echartsBarData) => { const result = params.map((item, index) => { const str = item.name.substring(0, 1); if (echartsBarData[i 阅读全文
posted @ 2023-07-31 15:36 Webwhl 阅读(79) 评论(0) 推荐(0) 编辑