Comments (6)
@cgisky1980
页面清理之后精简版也发不了
这几天在集中完善nuxt3版本,一边进行迁移一边也在重构,这段时间重心可能会放在nuxt3版本了,自动生成侧边栏,我抽空添加到nuxt版本上吧
from lux-ui.
我自己改写 apps.routes.ts 实现了一下路由自动加载,不过 没有 vite-plugin-pages 强大,没实现 /:id 这样的路由,vpp 插件可以实现。
const metaRouters = import.meta.glob("@/views/demos/**/App.vue", {
eager: true,
});
export const routes: Array<{
path: string;
meta: {
requiresAuth: boolean;
layout: string;
category: string;
};
component: () => Promise<any>;
children: Array<{
path: string;
redirect?: string;
name?: string;
component?: () => Promise<any>;
}>;
}> = [];
Object.keys(metaRouters).forEach((item) => {
let dirname = item.match(/\/src\/views\/demos\/(\S*)\/App.vue/);
if (dirname !== null && dirname[1] !== null && dirname[0] !== null) {
// let rr = "/src/views/demos/" + dirname[1] + "/Routes.ts";
let routs = {
path: "/demos/" + dirname[1],
meta: {
requiresAuth: true,
layout: "ui",
category: "DEMOS",
},
component: () => import(dirname[0]),
children: [] as Array<{
path: string;
redirect?: string;
name?: string;
component?: () => Promise<any>;
}>,
};
let pagesroutes: Array<{
path: string;
redirect?: string;
name?: string;
component?: () => Promise<any>;
}> = [
{
path: "",
redirect: "/demos/" + dirname[1] + "/main",
},
];
const pageR = import.meta.glob("/src/views/demos/*/pages/*.vue", {
eager: true,
});
Object.keys(pageR).forEach((item) => {
const pagesDirRegex = new RegExp(`\\/src\\/views\\/demos\\/${dirname[1]}\\/pages\\/(\\S*)\\.vue`);
const matchResult = item.match(pagesDirRegex);
if (matchResult) {
// 匹配到.vue文件路径
// console.log(matchResult[0]);
// 进一步处理该路径
let pagesroute = {
path: matchResult[1],
component: () => import(matchResult[0]),
name: dirname[1] +'-'+matchResult[1],
};
pagesroutes.push(pagesroute);
}
});
routs.children = pagesroutes;
routes.push(routs);
}
});
export default routes;```
from lux-ui.
这个我先看一下,通过子目录生成侧边栏的话,我觉得还是nuxt3版本添加这个功能比较合适,这个项目说实话pages页面比较混乱且数量多,实现这个成本巨大
from lux-ui.
@yangjiakai 我自己使用的话 pages 都清理了。 目前的项目结构,要清理或者添加新的页面 都很麻烦,
需要 locales 中N个文件处理 、router 处理 、 navigation.ts 还有 menu中处理。 nuxt3版本 就很清爽
以后再做迁移吧
from lux-ui.
nuxt3 好像本身就带自动路由了
from lux-ui.
我自己写的那玩意 dev可以 打包的时候 那几个VUE没编译进去 还是用vite-plugin-pages
from lux-ui.
Related Issues (20)
- 发送消息过后等待的过程,可以让输入框有个加载等待的提示,就像chatgpt官方的那样 HOT 3
- 可以docker-compose部署吗,npm部署出现如下问题 HOT 5
- chatbot1提问完问题过后应该重新把位置定位到最下面 HOT 2
- 优化手机端操作体验,手机端侧边栏前三次应该自动打开 HOT 2
- 微信浏览器和手机浏览器都加载不出来,这两张图片的url不一样 HOT 1
- 应该禁止连续发送,一条发送完成过后应该登录loading结束才能发下一条 HOT 1
- v-data-table-server下面选择不应该有all这个选项
- 新增表单组件 HOT 1
- 右边设置primary的color应该要持久化 HOT 1
- 用360浏览器出现空隙 HOT 1
- 这个googleapis.com域名,在国内访问速度有点慢
- 在chatbog1页面,小火箭在ios上不见了
- 新功能:集成类似CodeSandbox的在线IDE
- 页面的背景要跟随黑色主题
- v-text-field for apikey is disabled for input
- 网页一直显示:正在加载 HOT 2
- [Question] 请问该项目目前拥有滑块相关的组件吗? HOT 1
- Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type HOT 3
- 将默认语言换为中文后依然显示英文 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lux-ui.