草庐IT

vue-3d-loader

全部标签

javascript - 使用 Vue.js 的异步/等待 axios 调用

我在设置其中一个时遇到了一些麻烦。我的Vue.js应用程序中的值。我相信我要么没有正确理解异步axios调用,要么没有理解异步在Vue.js中的工作方式。我有以下三种方法:updateAvailability(availability){if(availability==true){this.showYourDetails();}else{this.showBookingDetails();}},checkAvailability:asyncfunction(event){event.preventDefault();constavailability=awaitthis.handle

javascript - Vue 子组件属性不起作用

我正在尝试破解此代码[A](请参阅底部的fiddle):{{file.__progress}}%进入[B]基本相同的代码,但随后带有一个子组件。这里是父级:这里是child:{{file.__progress}}%在child身上我设置了file属性:props:{file:{type:File,required:true}},父子代码中一定存在问题,因为file__img属性在[B]中的子项(渲染时)中不存在,请参阅:,而它确实存在于[A]中:怎么了?控制台没有错误。原始([A])代码来自here.FileObject由一个xhr实例组成(我想?!)。这里是[A]的fiddle/沙盒

javascript - 如何在同一个应用程序中使用 2 个具有不同 baseURL 的 Axios 实例 (vue.js)

我正在尝试学习vue.js,所以我制作了一个小应用程序来显示来自API的新闻文章,并在另一个View中允许用户登录到另一个服务器。为此,我使用Axios。我知道我在某些时候让它工作得很好,但今天开始我的项目时,让两个api同时工作是不可能的。这是我的登录服务:importaxiosTrainingAPIfrom'axios'axiosTrainingAPI.defaults.baseURL='https://api.example.com'consttrainingAPI={login(credentials){returnnewPromise((resolve,reject)=>{a

javascript - 模块构建失败(来自 ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-react'

在尝试使用Webpack4和Babel7构建React应用程序时,我遇到了以下错误。ERRORin./src/index.jsModulebuildfailed(from./node_modules/babel-loader/lib/index.js):Error:Cannotfindmodule'babel-preset-react'from'/Users/me/Desktop/reflask'-Ifyouwanttoresolve"react",use"module:react"-Didyoumean"@babel/react"?atFunction.module.exports[

javascript - 在过滤器方法中访问 vue 实例/数据

我正在尝试像这样访问过滤器函数内的vue实例数据。JS:-newVue({data:{amount:10,exchangeRate:50},el:"#app",filters:{currency:function(amount){console.log(this);//returnamount*this.exchangeRate;returnamount*50;}}})HTML:{{amount|currency}}我的目标是使用returnamount*this.exchangeRate;但是this等于window这里。我怎样才能做到这一点?谢谢。jsfiddle

javascript - translate3d 的 css3 替代品?

我正在尝试转换为ipad等支持触摸的设备制作的JS脚本,以便它可以与鼠标手势一起使用。该脚本使用translate3d,(我认为)它是特定于webkit的,但我想让它在尽可能多的浏览器中工作。那么,translate3d的CSS3替代品是什么?这是它在JavaScript中的使用方式:element.style.webkitTransform='translate3d(500px,0,0)';我对CSS3的了解非常有限,因此非常感谢您提供任何示例/解释。 最佳答案 Translate3d是CSS3,大多数浏览器还没有实现它(Chro

javascript - Webpack 4、postcss-loader 和 autoprefixer 插件

我对让自动前缀器工作感到非常沮丧。这是我的webpack.config.jsconstHtmlWebPackPlugin=require("html-webpack-plugin");constMiniCssExtractPlugin=require("mini-css-extract-plugin");constconfig={module:{rules:[{test:/\.js$/,exclude:/node_modules/,use:{loader:"babel-loader"}},{test:/\.(scss)$/,use:[MiniCssExtractPlugin.loade

javascript/vue.js 接收json

我正在尝试像这样在我的vue.js应用程序中接收json:newVue({el:'body',data:{role:'',company:'',list:[],created:function(){this.getJson();},methods:{getJson:function(){$.getJSON('http://domain.dev/data',function(task){this.list=task;}.bind(this));}}}});但结果为空?当我在postman中对此进行测试时,url返回json。我在这里做错了什么?编辑:JSON(测试数据):{"Employ

javascript - Vue.js: 从 "parent"Vue 获取数据

我有一个(不可更改的)DOM结构如下:.........还有两个js文件:index.js:varchild=require('childVue');module.exports=newVue({el:'#indexVue',...});childVue.js:module.exports=newVue({el:'#childVue',methods:{something:function(){//Parentdataneededhere...},...}});如图所示,我需要indexVue的数据在childVue.有什么办法可以传递给它吗?我试图将它传递给带有(v-on="clic

Unity3d+GameFramework:资源分析,资源依赖,循环依赖检测

资源依赖先生成Resource根据ResourceCollection.xmlResourceresource=Resource.Create(name,variant,fileSystem,loadType,packed,resourceGroups);m_Resources.Add(resource.FullName.ToLowerInvariant(),resource);增加打包资源:luoyikun/Cube1–>{“m_Assets”:[],“m_ResourceGroups”:[],“Name”:“luoyikun/Cube1”,“Variant”:null,“FullName”