feat:添加测试页面并优化时间戳工具
refactor: 优化时间戳转换组件及整体代码结构 chore: 更新构建配置和包依赖项
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { sendMessage } from '@/utils/messages';
|
||||
import { Button } from '@mui/material';
|
||||
|
||||
const TestPage = () => {
|
||||
const handleSeedMessage = async () => {
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
tabs.forEach(async (tab) => {
|
||||
console.log(tab.id);
|
||||
const length = await sendMessage('getStringLength', 'hello world', tab.id);
|
||||
console.log('字符串长度:', length);
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<Button variant="contained" color="primary" onClick={handleSeedMessage}>
|
||||
发送消息
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TestPage;
|
||||
Reference in New Issue
Block a user