以下是我的连接请求代码:
doLogin(this.login).then(response => {
var token = response.data.token;
localStorage.setItem('AUTH_TOKEN', JSON.stringify(token));
this.$router.push({name: 'Devices'});
});
}).catch(error => {
console.log(error.response.data.message);
});
Run Code Online (Sandbox Code Playgroud)
该catch()部分工作正常的HTTP错误(例如400,404,403...等).但是当我的服务器离线时,这个脚本就会抛出net::ERR_CONNECTION_REFUSED.有没有办法处理此错误并让前端用户知道服务器当前处于脱机状态.
这是doLogin()函数以防万一,
function doLogin(data) {
const url = 'http://localhost:3000/authenticate';
return axios.post(url,data);
}
Run Code Online (Sandbox Code Playgroud) 我刚刚开始Android应用程序开发.这里我有一个包含WebView的简单Activity.当我尝试打开一个网站(如http://www.google.com)时,它工作正常.但我想打开一个html文件(假设index.html)文件,我在我的应用程序的'res'目录中创建.完整路径是'res/base/index.html'.那么如何在我的WebView中打开这个文件.
工作:
webview.loadUrl("http://www.google.com");
Run Code Online (Sandbox Code Playgroud)
不工作:
webview.loadUrl("./res/base/index.html");
Run Code Online (Sandbox Code Playgroud)
请帮我.:)
在我的网站的cpanel中显示了这一点
Apache版本:2.0.63 PHP版本:5.2.9 MySQL版本:5.0.92-community操作系统:linux
我目前在服务器内安装了一个joomla网站.我使用名为"negetics PSS"的模块作为我的主页横幅.
以下是横幅的工作模型:http: //extensions.negetics.de/negetics-Presentation-Slider-Slim/demo-1.html
正如你在演示中看到的那样,该滑块的6个手柄是使用php imagecreatetruecolor函数生成的.现在我的问题是,当我在我的服务器中使用此模块时,该模块在其错误日志中生成错误:
[24-Oct-2011 02:32:27] PHP致命错误:在.....中调用未定义的函数imagecreatetruecolor()
结果你可以想象,手柄没有产生.我该如何解决..?请帮我.
谢谢
我的路线定义如下:
<Route path='/result/:searchTerm' component={Result}/>
Run Code Online (Sandbox Code Playgroud)
它工作正常.例如localhost:3000/result/cat页面工作.但是当用户决定:searchTerm从URL中删除并打开时,localhost:3000/result/它只显示空白页面.没有错误或任何东西.只是空页.它甚至没有击中我的组件{Result}.
所以我怀疑如何处理这种情况.说我想重定向谁尝试打开该用户/result/没有:searchTerms到我的索引页?怎么做.?
我无法在插入产品时找到有关添加图像的正确文档.这是我的xml产品导入脚本的工作代码.我不知道如何在添加产品时添加产品图像.
foreach ($xml->Products as $product_xml)
{
if ($product_xml->Valid_internet_product == 1)
{
/* Update an existing product or Create a new one */
$id_product = (int)Db::getInstance()->getValue('SELECT id_product FROM '._DB_PREFIX_.'product WHERE reference = \''.pSQL($product_xml->Reference).'\'');
$product = $id_product ? new Product((int)$id_product, true) : new Product();
$product->reference = $product_xml->Reference;
$product->price = (float)$product_xml->Price;
$product->active = (int)$product_xml->Active_product;
$product->weight = (float)$product_xml->Weight;
$product->minimal_quantity = (int)$product_xml->MinOrderQty;
$product->id_category_default = 2;
$product->name = utf8_encode($product_xml->Products_name);
$product->description = utf8_encode($product_xml->Description);
$product->description_short = utf8_encode($product_xml->Short_Description);
$product->link_rewrite = Tools::link_rewrite($product_xml->Products_name);
$product->image_url = 'http://i.imgur.com/jLThaBj.jpg';
if (!isset($product->date_add) || empty($product->date_add))
$product->date_add …Run Code Online (Sandbox Code Playgroud) 我对Vue.js完全陌生,因此我觉得问题很简单。这是我的Test.vue组件:
<template>
<p>Hello Worldd</p>
</template>
<script>
export default {
name : 'test'
}
</script>
Run Code Online (Sandbox Code Playgroud)
我正在尝试在另一个名为的组件中显示此“ Hello Worldd” UserDevices.vue。这是该文件的内容:
<template>
<div>
<test></test>
<p>test</p>
</div>
</template>
<script>
import Test from './Test'
export default {
name: 'UserDevices',
components: {Test}
}
Run Code Online (Sandbox Code Playgroud)
我收到一个错误消息:
[Vue warn]: Unknown custom element: <test> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <UserDevices> at src/components/UserDevices.vue
<App> at src/App.vue
<Root>
Run Code Online (Sandbox Code Playgroud)
我正在将webpack支架用于vue作为模板。这不是这样做的正确方法吗?
我知道如何在文本小部件中使用省略号。overflow: TextOverflow.ellipsis这项工作做得很好。但我的问题是它实际上只显示一行。我正在尝试制作类似于下图的布局:
如何在 Flutter 中做到这一点?
这是一个常见的布局,遗憾的是它没有在任何地方记录:(
很可能我的 SliverGrid 概念完全错误,
我想要做的是,在 UI 方面,我想要 Flutter 中已经提供的可折叠 SliverAppBar。我的主要内容主体是来自 API 响应的一组图像,并且已经解析并加载到 List 变量中。
现在这是我的代码:
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(expandedHeight: 150.0, backgroundColor: Colors.green),
SliverGrid(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3
),
delegate: SliverChildBuilderDelegate((BuildContext context, int index){
return Padding(
padding: EdgeInsets.symmetric(horizontal: 2.0, vertical: 2.0),
child: InkWell(
child: Card(
elevation: 8.0,
child: FadeInImage.memoryNetwork(fit: BoxFit.cover,image: myimagelist[index].thumbnail, placeholder:kTransparentImage,fadeInCurve: Curves.bounceIn,),
),
)
);
}),
),
],
),
Run Code Online (Sandbox Code Playgroud)
我想这可能是因为我无法告诉小部件我的数据有多长。对于 GridView.builderitemCount参数是有的,但 SliverGrid 没有这样的选项。在这里做什么?
dart ×2
flutter ×2
php ×2
vue.js ×2
android ×1
axios ×1
fatal-error ×1
javascript ×1
joomla1.5 ×1
prestashop ×1
reactjs ×1
sliver-grid ×1
vue-loader ×1
vuejs2 ×1
webview ×1