bootstrap 5

<script setup>
const loadTheme = (themeName) => {
  // 移除现有的主题link标签
  const existingLink = document.getElementById('theme-style');
  if (existingLink) {
    existingLink.remove();
  }
  
  // 创建新的link标签
  const link = document.createElement('link');
  link.id = 'theme-style';
  link.rel = 'stylesheet';
  link.href = `/themes/${themeName}.css`;
  
  // 添加到head
  document.head.appendChild(link);
};

// 使用示例
loadTheme('dark'); // 加载dark.css
</script>