草庐IT

github无法访问

全部标签

javascript - 从 react 组件中的html文件中的脚本标签访问变量

关闭。这个问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭6年前。Improvethisquestion我最近才开始研究javascript和React.js。目前我的main.html文件中有一些脚本标签,我需要能够从我的React.js组件中的这些标签访问一些变量。有办法做到这一点吗?

javascript - 从 atom Electron 中的 webview 访问 DOM

是否可以从原子Electron桌面开发工具包中的webview元素中抓取html,我正在尝试访问DOM但我什么也没得到,我在运行时尝试了控制台中的document.links但我得到了空属性和对象作为返回?window.onresize=doLayout;varisLoading=false;onload=function(){varwebview=document.querySelector('webview');doLayout();vart=webview.executeJavaScript("console.log(document.links);");document.que

javascript - typescript 无法导入没有扩展名的文件

我正在尝试在我的新Angular2项目中导入文件。入口文件“main.ts”能够使用以下方式导入其他typescript文件:import{AppModule}from'./module/app.module';另一方面,“app.module.ts”无法导入没有文件扩展名的ts文件:import{AppComponent}from'../component/app.component';如果我在文件名中添加“.ts”,一切都会按预期进行...我的错误是什么?我假设我正在按照Angular指南(https://angular.io/docs/ts/latest/guide/webpac

javascript - 在 React 中的现有状态转换错误期间无法更新

在我的渲染return()中,我有这些:Today这是什么函数:selectTimeframe(timeframe){//this.setState({timeframe});}^我现在必须注释掉setState否则我会收到我在上面发布的错误并且应用程序中断。我的构造函数中有这个:this.selectTimeframe=this.selectTimeframe.bind(this);我找到了这个answerhere,但这没有意义,我应该如何传递变量?或者他是说每个独特的按钮都需要独特的功能?至于避免在渲染内部调用它?完整代码importReactfrom'react';exportc

javascript - Vue Js - 无法读取未定义的属性 - (但它在浏览器上呈现)

我在Vue上有这种奇怪的行为。我正在尝试呈现一个名为descrizione的对象的嵌套属性并且它有效!但在控制台中,我收到来自Vue的警告:TypeError:Cannotreadproperty'descrizione'ofundefined"这是我的代码:HTML{{modello.lineaGialla.descrizione}}{{modello.lineaBlu.descrizione}}JSON{"lineaGialla":{"class":"gialla","selected":false,"descrizione":"Questaèlineagialla","descr

javascript - Webpack 无法导入从 git 安装的包

所以我在git中fork了一个包。做了我的改变。然后在我的终端npminstall--savegit+https://github.com/hayk94/ddp.js.git然后我尝试像这样在我的代码中导入包importDDPfrom'ddp.js'但是webpack给我这个错误ERRORin./main.jsModulenotfound:Error:Can'tresolve'ddp.js'in'/Users/hayksafaryan/projects/b2cEmbedLib'@./main.js23:11-28@multi(webpack)-dev-server/client?htt

javascript - 如何访问 promise `.then` 方法之外的变量?

我正在开发Spotify应用程序。我能够登录并获取我的token。我的问题是我无法访问方法外的变量。在这种情况下"getCurrentUser"这是我的方法:functiongetUser(){if($localStorage.token==undefined){throwalert("Notloggedin");}else{Spotify.getCurrentUser().then(function(data){varnames=JSON.stringify(data.data.display_name);console.log(names)})}};如您所见,我在console.l

javascript - 在 GitHub Pages 上设置 Gatsby

我一直在为自己设置一个reactjsweb应用程序/webpack等做噩梦。所以现在我正在使用Gatsby,它救了我的命!!!!我已经使用NPM在本地安装了Gatsby。我想将它部署到我的Github页面...它有点工作...以下是我遵循的说明:https://www.gatsbyjs.org/docs/deploy-gatsby/#github-pages这是我在GitHub.io页面上看到的:https://reenaverma.github.io/它不是默认的入门包索引页面/内容,我在我的本地主机8000上看到了。我可以在我的Github存储库上看到正确的内容已部署到Github

javascript - Prismic - 如何在不暴露访问 token 的情况下进行 API 调用

我正在构建一个vuejs网络应用程序,我想分别调用我的prismic存储库,但我不知道如何在不暴露我的访问token的情况下执行此操作。我正在使用所示的其余api方法here.有任何想法吗?http请求语法如下。我想在不暴露access_token的情况下在我的vue组件中执行此操作。http://your-repository-name.prismic.io/api/v2/documents/search?ref=Your_Ref&access_token=Your_Token在我的API/安全设置中,我还获得了客户端ID和客户端密码。我也不知道如何使用这些。谢谢

javascript - 无法将 Vuetify 项目更新为 vuetify 2.0.0-beta5

从vuetifyLTS更新时遇到问题至vuetify2.0.0-beta.5.在一切正常之前,vuetify样式从app.scss加载错误:[Vuewarn]:Erroringetterforwatcher"isDark":"TypeError:Cannotreadproperty'dark'ofundefined"TypeError:Cannotreadproperty'dark'ofundefined[Vuewarn]:Errorinrender:"TypeError:Cannotreadproperty'dark'ofundefined"我已经卸载了vuetify,然后像这样安装