我想将Vue.js变量与图像URL连接起来.
我计算的是:
imgPreUrl : function() {
if (androidBuild) return "android_asset/www/";
else return "";
}
Run Code Online (Sandbox Code Playgroud)
如果我为android构建:
<img src="/android_asset/www/img/logo.png">
Run Code Online (Sandbox Code Playgroud)
其他
<img src="img/logo.png">
Run Code Online (Sandbox Code Playgroud)
如何将计算变量与URL连接?
我尝试过这个:
<img src="{{imgPreUrl}}img/logo.png">
Run Code Online (Sandbox Code Playgroud) 我需要在我的应用程序上使用Camera2 API.(Api21 +)我找到了下一个样本:https: //github.com/googlesamples/android-Camera2Basic
我下载了它并开始使用我的手机.当我按下"图片"按钮时,它会调用takePhoto方法.
private void takePicture() {
lockFocus();
}
Run Code Online (Sandbox Code Playgroud)
这是一台国家机器.有时这台机器卡住了STATE_WAITING_LOCK.我的设备正在等待Focus,但没有任何反应!(是的,我的设备支持自动对焦)
case STATE_WAITING_LOCK: {
Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
if (afState == null) {
captureStillPicture();
} else if (CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState ||
CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) {
// CONTROL_AE_STATE can be null on some devices
Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
if (aeState == null ||
aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED) {
mState = STATE_PICTURE_TAKEN;
captureStillPicture();
} else {
runPrecaptureSequence();
}
}
break;
}
Run Code Online (Sandbox Code Playgroud)
这个问题有什么好的解决方案?这个程序有时会在这里崩溃:
private void unlockFocus() {
try { …Run Code Online (Sandbox Code Playgroud) 我在mysql中有一个"datetime"字段.
$time = "1900-01-01 00:00:00";
Run Code Online (Sandbox Code Playgroud)
我只能得到一年.我试过了$time -> year,但不好.
(试图获取非对象的属性)也许我需要将此字符串转换为日期?
我希望有一个人可以帮助我!非常感谢!
我已经使用了这个Vue.js路由示例应用程序.
https://github.com/chrisvfritz/vue-2.0-simple-routing-example
Run Code Online (Sandbox Code Playgroud)
在src/main.js
我有这么多的数据值.
const app = new Vue({
el: '#app',
data: {
currentRoute: window.location.pathname,
token : "",
errorMessage : '', etc...etc..
},
Run Code Online (Sandbox Code Playgroud)
现在使用socket.io我将令牌设置为 "sdawdda2d2ada2ad22ad"
当应用程序启动时,currentRoute等于"/"
其okey,第一页加载.src/routes.js
'/': 'Home',
'/about': 'About'
Run Code Online (Sandbox Code Playgroud)
当我想检查/ about(url :)时localhost:8080/about,它的工作效果不错,但令牌和errorMessage再次为空,因为应用程序再次创建.
如果我想更改页面而不丢失令牌值,我可以使用:
this.currentRoute = "/about" (url: localhost:8080)
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但网址没有改变,所以我不能在浏览器中使用后退按钮.如果我不希望在浏览器转到/关闭时丢失令牌值,我如何分离我的Vue应用程序?
非常感谢!
javascript ×2
vue.js ×2
android ×1
laravel ×1
laravel-5 ×1
mysql ×1
php ×1
php-carbon ×1
vue-router ×1
vuejs2 ×1