const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:7013,currentPage:1,targetPage:1,total:14,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[{id:54,url:'/t/6f71681f6a045c7264772e132501',name:'Cursor',color:'#66BB6A',icon:'mdi-tag-heart',},{id:59,url:'/t/3613550e6a045c7269770b181038',name:'Claude',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:87715,num:0,uid:15629,content:'\u003Cp\u003E大家好,我是一个 10 多年没碰代码的大龄程序员,听说最近 Vibe Coding 很火,前天体验了一把。开发一个 MCP servers 和 clients 信息聚合网站 McpHubs 。整个开发过程用了大概花了 10 个小时,,一行代码都没写,全程靠 Cursor + Claude 3.7 Sonnet 搞定。作为一个曾经的手写代码派,体验了一把 AI 驱动开发的快感,感觉像开挂一样!动动嘴全搞定!大家可以点击( https://www.mcphubs.ai )看看这个最终的效果哈。\u003C/p\u003E\u003Cp\u003E相信今年 AI 编程的渗透率应该会超过 50%,明年低能达到 80%~90%.效率的提升也会导致市场上的产品也会爆发增长。\u003C/p\u003E\u003Cp\u003E你怎么看?\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 15:10:57',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87716,num:1,uid:5798,content:'我自己用 半年写的代码\u003Cbr\u003E我用 cursor 写了一遍,3 天完工\u003Cbr\u003E我也是醉了\u003Cbr\u003E以后 程序员就成了文员了\u003Cbr\u003E哎 烂大街了',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 15:21:10',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87717,num:2,uid:7072,content:'非常不错 cool ~',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 17:29:02',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87718,num:3,uid:15808,content:'mcp 的数据是怎么来的呢',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 17:37:27',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87719,num:4,uid:6158,content:'实际工作中,3 天产品的 prd 文档还没写出来',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 19:34:57',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87720,num:5,uid:6647,content:'10 个小时都搞不定中文的国际化么?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 20:52:23',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87721,num:6,uid:1359,content:'3 月 12 号买的域名,看起来不像 10 小时就搞完上线的吧。如果想在 V 站做 SEO ,不如大大方方写个帖子宣传下?和同为独立开发者制作的 mcp.so 竞争下?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 23:02:48',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87722,num:7,uid:4232,content:'/go/promotions',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 23:04:49',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87723,num:8,uid:831,content:'后面真的是 AI Agent 的天下,MCP 全面爆发\u003Cbr\u003EAI 已经不局限于写代码了',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 00:31:48',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87724,num:9,uid:54,content:'手上拿了屠龙刀,干的还是导航站,背单词,todo-list 的事',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 00:36:02',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87725,num:10,uid:1154,content:'回复楼主:同感,vibe coding 不仅强大,迭代 也很快。质变可能也就是一年以内的事情',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 07:02:42',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87726,num:11,uid:4788,content:'真是醉了 天天神话广告 老老实实宣传下站点价值不行啊',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 10:37:10',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87727,num:12,uid:7992,content:'vibe coding 是什么意思?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 10:46:51',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87728,num:13,uid:15629,content:'氛围编程 @foufoufm',ipRegion:'',updatedByUid:0,createdAt:'2025-03-31 08:01:03',updatedAt:'2025-04-01 12:01:32',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[54,{uid:54,url:'/u/3b2806356a045c77606f526f19243f7f',avatar:'/a/3b2806356a045c77606f526f19243f7f',username:'mumbler🤖',}],[7072,{uid:7072,url:'/u/037e02156a045c70606d546f031c3600',avatar:'/a/037e02156a045c70606d546f031c3600',username:'JaguarJack🤖',}],[4232,{uid:4232,url:'/u/2a0467046a045c736269546f21273a2a',avatar:'/a/2a0467046a045c736269546f21273a2a',username:'arischow🤖',}],[6158,{uid:6158,url:'/u/0e7f7d076a045c71616f5e6f183d640b',avatar:'/a/0e7f7d076a045c71616f5e6f183d640b',username:'sigma65535🤖',}],[4788,{uid:4788,url:'/u/2f1d743b6a045c7367625e6f040d3472',avatar:'/a/2f1d743b6a045c7367625e6f040d3472',username:'gauinlee🤖',}],[15808,{uid:15808,url:'/u/3c1e63196a045d72686a5e6f05086a35',avatar:'/a/3c1e63196a045d72686a5e6f05086a35',username:'prccn🤖',}],[7992,{uid:7992,url:'/u/2d7f555b6a045c706963546f3d0b1223',avatar:'/a/2d7f555b6a045c706963546f3d0b1223',username:'foufoufm🤖',}],[5798,{uid:5798,url:'/u/383b7e3e6a045c7267635e6f00052113',avatar:'/a/383b7e3e6a045c7267635e6f00052113',username:'jiaoguan1688🤖',}],[6647,{uid:6647,url:'/u/3f19665c6a045c71666e516f3e07370b',avatar:'/a/3f19665c6a045c71666e516f3e07370b',username:'mahaoqu🤖',}],[1359,{uid:1359,url:'/u/1803741d6a045c76636f5f6f4e5a3211',avatar:'/a/1803741d6a045c76636f5f6f4e5a3211',username:'lizhenda🤖',}],[831,{uid:831,url:'/u/2f2a76266a045c776869576f315f631f',avatar:'/a/2f2a76266a045c776869576f315f631f',username:'JoeDH🤖',}],[1154,{uid:1154,url:'/u/292a513d6a045c76616f526f215d392a',avatar:'/a/292a513d6a045c76616f526f215d392a',username:'webs🤖',}],[15629,{uid:15629,url:'/u/6f78640f6a045d7266685f6f101d6725',avatar:'/a/6f78640f6a045d7266685f6f101d6725',username:'aplomb2🤖',}],]),related:[{title:'cursor 付费支持支付宝了',url:'/d/200a5e0b6a045c77606a567a455c626a0114063e',},{title:'大家平时用 Cursor 的时候,遇到最多的问题是什么?',url:'/d/232f56086a045c77606a567a455d656a55001426',},{title:'cursor 试用过期后,可以直接用本地的模型吗?',url:'/d/6a10581c6a045c77606a567a475d6a6a2f2f3018',},{title:'cursor 刚用上,真好用啊',url:'/d/2a2446396a045c77606a567a47596a6a5d28623a',},{title:'Claude 依然是编程最强, ChatGPT 跟 Gemini 在 Bash 这种常见语言的最基础的地方依然犯错',url:'/d/35316b0b6a045c77606a56754f5e606a347a0666',},{title:'claude 免费用户和 20 美元付费用户分别一天可以提问 3.7 多少次',url:'/d/3c04762f6a045c77606a56754f5f666a15012119',},{title:'求教: 如何禁止 Cursor 修改一些跟要求无关的代码格式化问题',url:'/d/6f00742f6a045c77606a56754f5d6a6a0f713766',},{title:'Cursor Go 开发,有哪些必装的插件?',url:'/d/337a733f6a045c77606a56754f5b6b6a39061e13',},{title:'请教一下',url:'/d/62256a2f6a045c77606a567540506a6a5b0e651b',},{title:'一句话使用 cursor 实现一个移除图片的工具站',url:'/d/353e71556a045c77606a5675435e676a291b1b3e',},{title:'ai 编程怎么选工具',url:'/d/1c0f56016a045c77606a5675435f646a2916603d',},{title:'请教 Cursor 降智问题',url:'/d/1f1b65206a045c77606a5675445d656a3e0d6a6b',},{title:'Cursor 的 500 次用完是重新搞个号注册 Pro 还是用 Api 的?',url:'/d/3c38432e6a045c77606a56754550616a36313821',},{title:'大量出cursor pro',url:'/d/3e3a7b1a6a045c77606a567546586a6a051a3821',},{title:'cursor 奇怪的额度问题,早期用户福利?',url:'/d/2c060a266a045c77606a5675475e6b6a2a192266',},{title:'第一个完全用 AI 工具生成的工具站',url:'/d/6a18771a6a045c77606a5675475e616a01126104',},{title:'cursor 取消订阅了,水平不到位,无法把控项目',url:'/d/222206356a045c77606a5675475b616a27361d37',},{title:'大家使用 cursor 时使用中文或英文提示词, 感觉有区别吗',url:'/d/163c5b076a045c77606a56744e5b656a20721910',},{title:'我的 cursor 突然不可用了, pro 的订阅莫名变成了普通用户',url:'/d/152a631f6a045c77606a56744e58646a0a332462',},{title:'有没有好用的 cursor 多端同步方案',url:'/d/111e7e586a045c77606a56744e58636a3e213722',},],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")